diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c1588a2..ef206e5 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -302,6 +302,7 @@ src/main/java/io/tiledb/cloud/rest_api/model/Attribute.java src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeader.java src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferSize.java src/main/java/io/tiledb/cloud/rest_api/model/Backoff.java +src/main/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequest.java src/main/java/io/tiledb/cloud/rest_api/model/Datatype.java src/main/java/io/tiledb/cloud/rest_api/model/Dimension.java src/main/java/io/tiledb/cloud/rest_api/model/DimensionCoordinate.java @@ -460,216 +461,3 @@ src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRange.java src/main/java/io/tiledb/cloud/rest_api/model/UDFType.java src/main/java/io/tiledb/cloud/rest_api/model/User.java src/main/java/io/tiledb/cloud/rest_api/model/Writer.java -src/test/java/io/tiledb/cloud/rest_api/api/ArrayApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/ArrayTasksApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/AssetsApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/FavoritesApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/FilesApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/GroupsApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/InvitationApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/NotebookApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/NotebooksApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/OrganizationApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/QueryApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/SqlApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/StatsApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphsApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/TasksApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/UdfApiTest.java -src/test/java/io/tiledb/cloud/rest_api/api/UserApiTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentialsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ActivityEventTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayActionsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayActivityLogTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebarTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoriteTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntryTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArraySampleTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArraySchemaTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArraySharingTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebarTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskLogTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AssetBackingTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AssetInfoTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AssetListResponseTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AssetLocationsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevelTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AssetTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeaderTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferSizeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/AttributeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/BackoffTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DatatypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DimensionCoordinateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DimensionTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DimensionTileExtentTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DomainArrayTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckResultTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DomainTest.java -src/test/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/EnumerationTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ErrorTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FileCreateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FileCreatedTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FileExportTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FileExportedTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FilePropertyNameTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FileTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FileUploadedTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FilterDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FilterOptionTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FilterPipelineTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FilterTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FilterTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoTest.java -src/test/java/io/tiledb/cloud/rest_api/model/FragmentMetadataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GenericUDFTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200ResponseTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupActionsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupChangesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAssetTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponseTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupCreateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupEntryTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupInfoTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupRegisterTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKeyTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/GroupUpdateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmailTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipientsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmailTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmailTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationTest.java -src/test/java/io/tiledb/cloud/rest_api/model/InvitationTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/LastAccessedArrayTest.java -src/test/java/io/tiledb/cloud/rest_api/model/LayoutTest.java -src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponseTest.java -src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponseTest.java -src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoriteTest.java -src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/MaxBufferSizesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntryTest.java -src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedTest.java -src/test/java/io/tiledb/cloud/rest_api/model/MultiArrayUDFTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NamespaceActionsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NonEmptyDomainTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopiedTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopyTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoriteTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/NotebookStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/OrganizationRolesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/OrganizationTest.java -src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUpdateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUserTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PaginationMetadataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PodStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsageTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PricingCurrencyTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PricingIntervalTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PricingTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PricingTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PricingUnitLabelTest.java -src/test/java/io/tiledb/cloud/rest_api/model/PublicShareFilterTest.java -src/test/java/io/tiledb/cloud/rest_api/model/QueryJsonTest.java -src/test/java/io/tiledb/cloud/rest_api/model/QueryRangesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/QueryReaderTest.java -src/test/java/io/tiledb/cloud/rest_api/model/QueryTest.java -src/test/java/io/tiledb/cloud/rest_api/model/QuerystatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/QuerytypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ReadStateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraphTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/ResultFormatTest.java -src/test/java/io/tiledb/cloud/rest_api/model/RetryPolicyTest.java -src/test/java/io/tiledb/cloud/rest_api/model/RetryStrategyTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SQLParametersTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponseTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SSODomainSetupTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SSOProviderTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SharePaymentRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfoTest.java -src/test/java/io/tiledb/cloud/rest_api/model/StorageLocationTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrentTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerStateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SubarrayRangesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SubarrayTest.java -src/test/java/io/tiledb/cloud/rest_api/model/SubscriptionTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGArrayNodeDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGInputNodeDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGQueryRangesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGSQLNodeDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGUDFArgumentTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResourcesTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGUDFNodeDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TGUDFStorageTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphActionsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocationTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatusTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphSharingTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInnerTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TokenRequestTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TokenScopeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/TokenTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFActionsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFArrayDetailsTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFCopiedTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFCopyTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoriteTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoritesDataTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFImageTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFImageVersionTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdateTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFLanguageTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFSharingTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRangeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UDFTypeTest.java -src/test/java/io/tiledb/cloud/rest_api/model/UserTest.java -src/test/java/io/tiledb/cloud/rest_api/model/WriterTest.java diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 6d54bbd..1985849 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +7.7.0 diff --git a/DEVELOP.md b/DEVELOP.md new file mode 100644 index 0000000..09ae291 --- /dev/null +++ b/DEVELOP.md @@ -0,0 +1,25 @@ +# Regenerate client: + +Install desired version of `openapi-generator-cli` ([docs](https://openapi-generator.tech/docs/installation)): +```bash +npm install @openapitools/openapi-generator-cli -g +openapi-generator-cli version-manager set 7.7.0 +openapi-generator generate -i openapi-v1.yaml -g java +``` + +Update local copy of spec from [`TileDB-Server//openapi/v1to3/src/openapi-v1.yaml`](https://github.com/TileDB-Inc/TileDB-Server/blob/main/openapi/v1to3/src/openapi-v1.yaml): +```bash +gh api \ + -H "Accept: application/vnd.github.raw" \ + /repos/TileDB-Inc/TileDB-Server/contents/openapi/v1to3/src/openapi-v1.yaml \ +> openapi-v1.yaml +``` + +Regenerate client ([`regen.sh`](regen.sh)): +```bash +./regen.sh +``` + +This regenerates the client code, `git add`s relevant files, and applies custom code / patches (see [`patch`]). + +[`patch`]: https://github.com/TileDB-Inc/TileDB-Cloud-Java/commit/patch diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..0b03ace --- /dev/null +++ b/config.yaml @@ -0,0 +1,4 @@ +additionalProperties: + apiPackage: io.tiledb.cloud.rest_api.api + modelPackage: io.tiledb.cloud.rest_api.model + hideGenerationTimestamp: true diff --git a/docs/ArrayApi.md b/docs/ArrayApi.md index b2d445b..4949da7 100644 --- a/docs/ArrayApi.md +++ b/docs/ArrayApi.md @@ -40,7 +40,7 @@ All URIs are relative to */v1* | [**vacuumArray**](ArrayApi.md#vacuumArray) | **POST** /arrays/{workspace}/{teamspace}/{array}/vacuum | | - + # **arrayActivityLog** > List<ArrayActivityLog> arrayActivityLog(workspace, teamspace, array, start, end, eventTypes, taskId, hasTaskId) @@ -49,52 +49,51 @@ All URIs are relative to */v1* get array activity logs ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer start = 56; // Integer | Start time of window of fetch logs, unix epoch in seconds (default: seven days ago) - Integer end = 56; // Integer | End time of window of fetch logs, unix epoch in seconds (default: current utc timestamp) - String eventTypes = "eventTypes_example"; // String | Refer to ActivityEventType for possible values - String taskId = "taskId_example"; // String | Array task ID To filter activity to - Boolean hasTaskId = true; // Boolean | Excludes activity log results that do not contain an array task UUID - try { - List result = apiInstance.arrayActivityLog(workspace, teamspace, array, start, end, eventTypes, taskId, hasTaskId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arrayActivityLog"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer start = 56; // Integer | Start time of window of fetch logs, unix epoch in seconds (default: seven days ago) + Integer end = 56; // Integer | End time of window of fetch logs, unix epoch in seconds (default: current utc timestamp) + String eventTypes = "eventTypes_example"; // String | Refer to ActivityEventType for possible values + String taskId = "taskId_example"; // String | Array task ID To filter activity to + Boolean hasTaskId = true; // Boolean | Excludes activity log results that do not contain an array task UUID + try { + List result = apiInstance.arrayActivityLog(workspace, teamspace, array, start, end, eventTypes, taskId, hasTaskId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arrayActivityLog"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -117,7 +116,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -131,7 +130,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysBrowserOwnedGet** > ArrayBrowserData arraysBrowserOwnedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata) @@ -140,56 +139,55 @@ public class Example { Fetch a list of all arrays that are owned directly by user or user's organizations ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String namespace = "namespace_example"; // String | namespace - String orderby = "orderby_example"; // String | sort by which field valid values include size, name - String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included - List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included - List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included - Boolean withMetadata = true; // Boolean | include the metadata of the array - try { - ArrayBrowserData result = apiInstance.arraysBrowserOwnedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysBrowserOwnedGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String namespace = "namespace_example"; // String | namespace + String orderby = "orderby_example"; // String | sort by which field valid values include size, name + String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included + List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included + List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included + Boolean withMetadata = true; // Boolean | include the metadata of the array + try { + ArrayBrowserData result = apiInstance.arraysBrowserOwnedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysBrowserOwnedGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -216,7 +214,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -230,7 +228,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysBrowserOwnedSidebarGet** > ArrayBrowserSidebar arraysBrowserOwnedSidebarGet(fileType, excludeFileType, fileProperty) @@ -239,47 +237,46 @@ public class Example { Fetch a sidebar for arrays that are owned directly by user or user's organizations ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included - List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included - List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included - try { - ArrayBrowserSidebar result = apiInstance.arraysBrowserOwnedSidebarGet(fileType, excludeFileType, fileProperty); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysBrowserOwnedSidebarGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included + List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included + List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included + try { + ArrayBrowserSidebar result = apiInstance.arraysBrowserOwnedSidebarGet(fileType, excludeFileType, fileProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysBrowserOwnedSidebarGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -297,7 +294,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -311,7 +308,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysBrowserPublicGet** > ArrayBrowserData arraysBrowserPublicGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata) @@ -320,56 +317,55 @@ public class Example { Fetch a list of all arrays that have been shared publically ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String namespace = "namespace_example"; // String | namespace - String orderby = "orderby_example"; // String | sort by which field valid values include size, name - String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included - List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included - List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included - Boolean withMetadata = true; // Boolean | include the metadata of the array - try { - ArrayBrowserData result = apiInstance.arraysBrowserPublicGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysBrowserPublicGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String namespace = "namespace_example"; // String | namespace + String orderby = "orderby_example"; // String | sort by which field valid values include size, name + String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included + List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included + List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included + Boolean withMetadata = true; // Boolean | include the metadata of the array + try { + ArrayBrowserData result = apiInstance.arraysBrowserPublicGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysBrowserPublicGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -396,7 +392,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -410,7 +406,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysBrowserPublicSidebarGet** > ArrayBrowserSidebar arraysBrowserPublicSidebarGet(fileType, excludeFileType, fileProperty) @@ -419,47 +415,46 @@ public class Example { Fetch a sidebar of all arrays that have been shared publically ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included - List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included - List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included - try { - ArrayBrowserSidebar result = apiInstance.arraysBrowserPublicSidebarGet(fileType, excludeFileType, fileProperty); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysBrowserPublicSidebarGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included + List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included + List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included + try { + ArrayBrowserSidebar result = apiInstance.arraysBrowserPublicSidebarGet(fileType, excludeFileType, fileProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysBrowserPublicSidebarGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -477,7 +472,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -491,7 +486,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysBrowserSharedGet** > ArrayBrowserData arraysBrowserSharedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, sharedTo, withMetadata) @@ -500,57 +495,56 @@ public class Example { Fetch a list of all arrays that have been shared with the user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String namespace = "namespace_example"; // String | namespace - String orderby = "orderby_example"; // String | sort by which field valid values include size, name - String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included - List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included - List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included - List sharedTo = Arrays.asList(); // List | namespaces to filter results of where there arrays were shared to - Boolean withMetadata = true; // Boolean | include the metadata of the array - try { - ArrayBrowserData result = apiInstance.arraysBrowserSharedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, sharedTo, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysBrowserSharedGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String namespace = "namespace_example"; // String | namespace + String orderby = "orderby_example"; // String | sort by which field valid values include size, name + String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included + List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included + List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included + List sharedTo = Arrays.asList(); // List | namespaces to filter results of where there arrays were shared to + Boolean withMetadata = true; // Boolean | include the metadata of the array + try { + ArrayBrowserData result = apiInstance.arraysBrowserSharedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, sharedTo, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysBrowserSharedGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -578,7 +572,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -592,7 +586,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysBrowserSharedSidebarGet** > ArrayBrowserSidebar arraysBrowserSharedSidebarGet(fileType, excludeFileType, fileProperty, sharedTo) @@ -601,48 +595,47 @@ public class Example { Fetch a list of all arrays that have been shared with the user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included - List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included - List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included - List sharedTo = Arrays.asList(); // List | namespaces to filter results of where there groups were shared to - try { - ArrayBrowserSidebar result = apiInstance.arraysBrowserSharedSidebarGet(fileType, excludeFileType, fileProperty, sharedTo); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysBrowserSharedSidebarGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + List fileType = Arrays.asList(); // List | file_type to search for, more than one can be included + List excludeFileType = Arrays.asList(); // List | file_type to exclude matching array in results, more than one can be included + List fileProperty = Arrays.asList(); // List | file_property key-value pair (comma separated, i.e. key,value) to search for, more than one can be included + List sharedTo = Arrays.asList(); // List | namespaces to filter results of where there groups were shared to + try { + ArrayBrowserSidebar result = apiInstance.arraysBrowserSharedSidebarGet(fileType, excludeFileType, fileProperty, sharedTo); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysBrowserSharedSidebarGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -661,7 +654,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -675,7 +668,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **arraysWorkspaceTeamspaceArrayEndTimestampsGet** > ArrayEndTimestampData arraysWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage) @@ -684,49 +677,48 @@ public class Example { retrieve a list of timestamps from the array fragment info listing in milliseconds, paginated ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - ArrayEndTimestampData result = apiInstance.arraysWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#arraysWorkspaceTeamspaceArrayEndTimestampsGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + ArrayEndTimestampData result = apiInstance.arraysWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#arraysWorkspaceTeamspaceArrayEndTimestampsGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -746,7 +738,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -760,7 +752,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **consolidateArray** > consolidateArray(workspace, teamspace, array, consolidateRequest) @@ -769,47 +761,46 @@ public class Example { consolidate an array at a specified URI ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - ArrayConsolidationRequest consolidateRequest = new ArrayConsolidationRequest(); // ArrayConsolidationRequest | Consolidate Request - try { - apiInstance.consolidateArray(workspace, teamspace, array, consolidateRequest); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#consolidateArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + ArrayConsolidationRequest consolidateRequest = new ArrayConsolidationRequest(); // ArrayConsolidationRequest | Consolidate Request + try { + apiInstance.consolidateArray(workspace, teamspace, array, consolidateRequest); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#consolidateArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -828,7 +819,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -842,7 +833,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **createArray** > createArray(workspace, teamspace, array, contentType, arraySchema, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME) @@ -851,49 +842,48 @@ null (empty response body) create a array schema at a specified URI registered to a group/project ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - ArraySchema arraySchema = new ArraySchema(); // ArraySchema | ArraySchema being created - String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation - try { - apiInstance.createArray(workspace, teamspace, array, contentType, arraySchema, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#createArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + ArraySchema arraySchema = new ArraySchema(); // ArraySchema | ArraySchema being created + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation + try { + apiInstance.createArray(workspace, teamspace, array, contentType, arraySchema, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#createArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -914,7 +904,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -928,7 +918,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteArray** > deleteArray(workspace, teamspace, array, contentType) @@ -937,47 +927,46 @@ null (empty response body) delete a array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - try { - apiInstance.deleteArray(workspace, teamspace, array, contentType); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#deleteArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + try { + apiInstance.deleteArray(workspace, teamspace, array, contentType); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#deleteArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -996,7 +985,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1010,7 +999,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deregisterArray** > deregisterArray(workspace, teamspace, array) @@ -1019,46 +1008,45 @@ null (empty response body) deregister a array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - try { - apiInstance.deregisterArray(workspace, teamspace, array); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#deregisterArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + try { + apiInstance.deregisterArray(workspace, teamspace, array); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#deregisterArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1076,7 +1064,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1090,7 +1078,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **fragmentInfo** > FragmentInfo fragmentInfo(workspace, teamspace, array, contentType, fragmentInfoRequest) @@ -1099,49 +1087,48 @@ null (empty response body) fetch an array's fragment info ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - FragmentInfoRequest fragmentInfoRequest = new FragmentInfoRequest(); // FragmentInfoRequest | ArraySchema being created - try { - FragmentInfo result = apiInstance.fragmentInfo(workspace, teamspace, array, contentType, fragmentInfoRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#fragmentInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + FragmentInfoRequest fragmentInfoRequest = new FragmentInfoRequest(); // FragmentInfoRequest | ArraySchema being created + try { + FragmentInfo result = apiInstance.fragmentInfo(workspace, teamspace, array, contentType, fragmentInfoRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#fragmentInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1161,7 +1148,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1174,7 +1161,7 @@ public class Example { | **200** | fragment info | - | | **0** | error response | - | - + # **getActivityLogById** > ArrayActivityLog getActivityLogById(workspace, teamspace, array, id) @@ -1183,48 +1170,47 @@ public class Example { get activity log by ID ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String id = "id_example"; // String | ID of the activity - try { - ArrayActivityLog result = apiInstance.getActivityLogById(workspace, teamspace, array, id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getActivityLogById"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String id = "id_example"; // String | ID of the activity + try { + ArrayActivityLog result = apiInstance.getActivityLogById(workspace, teamspace, array, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getActivityLogById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1243,7 +1229,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1257,7 +1243,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getAllArrayMetadata** > List<ArrayInfo> getAllArrayMetadata(publicShare) @@ -1266,45 +1252,44 @@ public class Example { get all array metadata user has access to ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String publicShare = "publicShare_example"; // String | Public share values can be one of exclude, only - try { - List result = apiInstance.getAllArrayMetadata(publicShare); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getAllArrayMetadata"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String publicShare = "publicShare_example"; // String | Public share values can be one of exclude, only + try { + List result = apiInstance.getAllArrayMetadata(publicShare); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getAllArrayMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1320,7 +1305,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1334,7 +1319,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArray** > ArraySchema getArray(workspace, teamspace, array, contentType) @@ -1343,48 +1328,47 @@ public class Example { get an ArraySchema using a url encoded uri ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - try { - ArraySchema result = apiInstance.getArray(workspace, teamspace, array, contentType); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + try { + ArraySchema result = apiInstance.getArray(workspace, teamspace, array, contentType); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1403,7 +1387,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1417,7 +1401,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayMaxBufferSizes** > MaxBufferSizes getArrayMaxBufferSizes(workspace, teamspace, array, subarray, contentType, xPayer) @@ -1426,50 +1410,49 @@ public class Example { get the max buffer sizes of an array for a subarray ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String subarray = "subarray_example"; // String | CSV string of subarray to get max buffer sizes for - String contentType = "application/json"; // String | Content Type of input and return mime - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - try { - MaxBufferSizes result = apiInstance.getArrayMaxBufferSizes(workspace, teamspace, array, subarray, contentType, xPayer); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArrayMaxBufferSizes"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String subarray = "subarray_example"; // String | CSV string of subarray to get max buffer sizes for + String contentType = "application/json"; // String | Content Type of input and return mime + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + try { + MaxBufferSizes result = apiInstance.getArrayMaxBufferSizes(workspace, teamspace, array, subarray, contentType, xPayer); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArrayMaxBufferSizes"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1490,7 +1473,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1504,58 +1487,57 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayMetaDataJson** -> Object getArrayMetaDataJson(workspace, teamspace, array, length, endTimestamp) +> Map<String, Object> getArrayMetaDataJson(workspace, teamspace, array, length, endTimestamp) get metadata from the array in JSON format ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer length = 56; // Integer | (optional) limit character length of returned values - Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch, metadata will use open_at functionality to open array at the specific timestamp - try { - Object result = apiInstance.getArrayMetaDataJson(workspace, teamspace, array, length, endTimestamp); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArrayMetaDataJson"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer length = 56; // Integer | (optional) limit character length of returned values + Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch, metadata will use open_at functionality to open array at the specific timestamp + try { + Map result = apiInstance.getArrayMetaDataJson(workspace, teamspace, array, length, endTimestamp); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArrayMetaDataJson"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1571,11 +1553,11 @@ public class Example { ### Return type -**Object** +**Map<String, Object>** ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1589,7 +1571,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayMetadata** > ArrayInfo getArrayMetadata(workspace, teamspace, array) @@ -1598,47 +1580,46 @@ public class Example { get metadata on an array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - try { - ArrayInfo result = apiInstance.getArrayMetadata(workspace, teamspace, array); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArrayMetadata"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + try { + ArrayInfo result = apiInstance.getArrayMetadata(workspace, teamspace, array); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArrayMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1656,7 +1637,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1670,7 +1651,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayMetadataCapnp** > ArrayMetadata getArrayMetadataCapnp(workspace, teamspace, array) @@ -1679,47 +1660,46 @@ public class Example { get metadata on an array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - try { - ArrayMetadata result = apiInstance.getArrayMetadataCapnp(workspace, teamspace, array); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArrayMetadataCapnp"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + try { + ArrayMetadata result = apiInstance.getArrayMetadataCapnp(workspace, teamspace, array); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArrayMetadataCapnp"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1737,7 +1717,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1751,7 +1731,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayNonEmptyDomain** > NonEmptyDomain getArrayNonEmptyDomain(workspace, teamspace, array, contentType, xPayer) @@ -1760,49 +1740,48 @@ public class Example { get the non empty domain of an array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - try { - NonEmptyDomain result = apiInstance.getArrayNonEmptyDomain(workspace, teamspace, array, contentType, xPayer); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArrayNonEmptyDomain"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + try { + NonEmptyDomain result = apiInstance.getArrayNonEmptyDomain(workspace, teamspace, array, contentType, xPayer); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArrayNonEmptyDomain"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1822,7 +1801,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1836,56 +1815,55 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayNonEmptyDomainJson** -> Object getArrayNonEmptyDomainJson(workspace, teamspace, array) +> Map<String, Object> getArrayNonEmptyDomainJson(workspace, teamspace, array) get non-empty domain from the array in json format ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - try { - Object result = apiInstance.getArrayNonEmptyDomainJson(workspace, teamspace, array); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArrayNonEmptyDomainJson"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + try { + Map result = apiInstance.getArrayNonEmptyDomainJson(workspace, teamspace, array); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArrayNonEmptyDomainJson"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1899,11 +1877,11 @@ public class Example { ### Return type -**Object** +**Map<String, Object>** ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1917,7 +1895,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArraySampleData** > ArraySample getArraySampleData(workspace, teamspace, array, samples) @@ -1926,48 +1904,47 @@ public class Example { get an sample set of data from the array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - BigDecimal samples = new BigDecimal("5.0"); // BigDecimal | Number of sample results to return - try { - ArraySample result = apiInstance.getArraySampleData(workspace, teamspace, array, samples); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArraySampleData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + BigDecimal samples = new BigDecimal("5.0"); // BigDecimal | Number of sample results to return + try { + ArraySample result = apiInstance.getArraySampleData(workspace, teamspace, array, samples); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArraySampleData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1986,7 +1963,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2000,7 +1977,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArraySharingPolicies** > List<ArraySharing> getArraySharingPolicies(workspace, teamspace, array) @@ -2009,47 +1986,46 @@ public class Example { Get all sharing details of the array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - try { - List result = apiInstance.getArraySharingPolicies(workspace, teamspace, array); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArraySharingPolicies"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + try { + List result = apiInstance.getArraySharingPolicies(workspace, teamspace, array); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArraySharingPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2067,7 +2043,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2082,7 +2058,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArraysInNamespace** > List<ArrayInfo> getArraysInNamespace(workspace, teamspace, withMetadata) @@ -2091,47 +2067,46 @@ public class Example { get metadata on all arrays in a namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - Boolean withMetadata = true; // Boolean | include the metadata of the arrays - try { - List result = apiInstance.getArraysInNamespace(workspace, teamspace, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getArraysInNamespace"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + Boolean withMetadata = true; // Boolean | include the metadata of the arrays + try { + List result = apiInstance.getArraysInNamespace(workspace, teamspace, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getArraysInNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2149,7 +2124,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2163,7 +2138,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getFragmentEndTimestamp** > Integer getFragmentEndTimestamp(workspace, teamspace, array, endTimestamp) @@ -2172,48 +2147,47 @@ public class Example { Get fragment end_timestamp on an array, will search for the closest end_timestamp to the timestamp asked ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch - try { - Integer result = apiInstance.getFragmentEndTimestamp(workspace, teamspace, array, endTimestamp); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getFragmentEndTimestamp"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch + try { + Integer result = apiInstance.getFragmentEndTimestamp(workspace, teamspace, array, endTimestamp); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getFragmentEndTimestamp"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2232,7 +2206,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2246,51 +2220,50 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getLastAccessedArrays** > List<LastAccessedArray> getLastAccessedArrays() ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - try { - List result = apiInstance.getLastAccessedArrays(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#getLastAccessedArrays"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + try { + List result = apiInstance.getLastAccessedArrays(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#getLastAccessedArrays"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2303,7 +2276,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2317,7 +2290,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **loadArraySchema** > LoadArraySchemaResponse loadArraySchema(workspace, teamspace, array, loadArraySchemaRequest) @@ -2326,48 +2299,47 @@ This endpoint does not need any parameter. request to get the array schema ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - LoadArraySchemaRequest loadArraySchemaRequest = new LoadArraySchemaRequest(); // LoadArraySchemaRequest | Load Array Schema Request - try { - LoadArraySchemaResponse result = apiInstance.loadArraySchema(workspace, teamspace, array, loadArraySchemaRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#loadArraySchema"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + LoadArraySchemaRequest loadArraySchemaRequest = new LoadArraySchemaRequest(); // LoadArraySchemaRequest | Load Array Schema Request + try { + LoadArraySchemaResponse result = apiInstance.loadArraySchema(workspace, teamspace, array, loadArraySchemaRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#loadArraySchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2386,7 +2358,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2401,7 +2373,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **loadEnumerations** > LoadEnumerationsResponse loadEnumerations(workspace, teamspace, array, loadEnumerationsRequest) @@ -2410,48 +2382,47 @@ public class Example { request to get the enumerations of the arrays' attributes ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - LoadEnumerationsRequest loadEnumerationsRequest = new LoadEnumerationsRequest(); // LoadEnumerationsRequest | Load Enumerations Request - try { - LoadEnumerationsResponse result = apiInstance.loadEnumerations(workspace, teamspace, array, loadEnumerationsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#loadEnumerations"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + LoadEnumerationsRequest loadEnumerationsRequest = new LoadEnumerationsRequest(); // LoadEnumerationsRequest | Load Enumerations Request + try { + LoadEnumerationsResponse result = apiInstance.loadEnumerations(workspace, teamspace, array, loadEnumerationsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#loadEnumerations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2470,7 +2441,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2485,7 +2456,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **registerArray** > ArrayInfo registerArray(workspace, teamspace, array, arrayMetadata) @@ -2494,48 +2465,47 @@ public class Example { register an array at a specified URI registered to the given namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - ArrayInfoUpdate arrayMetadata = new ArrayInfoUpdate(); // ArrayInfoUpdate | metadata associated with array - try { - ArrayInfo result = apiInstance.registerArray(workspace, teamspace, array, arrayMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#registerArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | asset id or path of array that is url-encoded + ArrayInfoUpdate arrayMetadata = new ArrayInfoUpdate(); // ArrayInfoUpdate | metadata associated with array + try { + ArrayInfo result = apiInstance.registerArray(workspace, teamspace, array, arrayMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#registerArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2545,7 +2515,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | | **teamspace** | **String**| the teamspace the array belongs to | | -| **array** | **String**| name/uri of array that is url-encoded | | +| **array** | **String**| asset id or path of array that is url-encoded | | | **arrayMetadata** | [**ArrayInfoUpdate**](ArrayInfoUpdate.md)| metadata associated with array | | ### Return type @@ -2554,7 +2524,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2568,7 +2538,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shareArray** > shareArray(workspace, teamspace, array, arraySharing) @@ -2577,47 +2547,46 @@ public class Example { Share an array with a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - ArraySharing arraySharing = new ArraySharing(); // ArraySharing | Namespace and list of permissions to share with. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the array will not be shared with the namespace at all. - try { - apiInstance.shareArray(workspace, teamspace, array, arraySharing); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#shareArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + ArraySharing arraySharing = new ArraySharing(); // ArraySharing | Namespace and list of permissions to share with. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the array will not be shared with the namespace at all. + try { + apiInstance.shareArray(workspace, teamspace, array, arraySharing); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#shareArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2636,7 +2605,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2651,7 +2620,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateArrayMetadata** > updateArrayMetadata(workspace, teamspace, array, arrayMetadata) @@ -2660,47 +2629,46 @@ null (empty response body) update metadata on an array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - ArrayInfoUpdate arrayMetadata = new ArrayInfoUpdate(); // ArrayInfoUpdate | array metadata to update - try { - apiInstance.updateArrayMetadata(workspace, teamspace, array, arrayMetadata); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#updateArrayMetadata"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + ArrayInfoUpdate arrayMetadata = new ArrayInfoUpdate(); // ArrayInfoUpdate | array metadata to update + try { + apiInstance.updateArrayMetadata(workspace, teamspace, array, arrayMetadata); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#updateArrayMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2719,7 +2687,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2733,7 +2701,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateArrayMetadataCapnp** > updateArrayMetadataCapnp(workspace, teamspace, array, arrayMetadataEntries) @@ -2742,47 +2710,46 @@ null (empty response body) update metadata on an array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - ArrayMetadata arrayMetadataEntries = new ArrayMetadata(); // ArrayMetadata | List of metadata entries - try { - apiInstance.updateArrayMetadataCapnp(workspace, teamspace, array, arrayMetadataEntries); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#updateArrayMetadataCapnp"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + ArrayMetadata arrayMetadataEntries = new ArrayMetadata(); // ArrayMetadata | List of metadata entries + try { + apiInstance.updateArrayMetadataCapnp(workspace, teamspace, array, arrayMetadataEntries); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#updateArrayMetadataCapnp"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2801,7 +2768,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -2815,7 +2782,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **vacuumArray** > vacuumArray(workspace, teamspace, array, vaccumRequest) @@ -2824,47 +2791,46 @@ null (empty response body) vacuum an array at a specified URI ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayApi apiInstance = new ArrayApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - ArrayVacuumRequest vaccumRequest = new ArrayVacuumRequest(); // ArrayVacuumRequest | Vaccum Request - try { - apiInstance.vacuumArray(workspace, teamspace, array, vaccumRequest); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayApi#vacuumArray"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayApi apiInstance = new ArrayApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + ArrayVacuumRequest vaccumRequest = new ArrayVacuumRequest(); // ArrayVacuumRequest | Vaccum Request + try { + apiInstance.vacuumArray(workspace, teamspace, array, vaccumRequest); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayApi#vacuumArray"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -2883,7 +2849,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/ArrayTasksApi.md b/docs/ArrayTasksApi.md index 5973b8e..c2d225f 100644 --- a/docs/ArrayTasksApi.md +++ b/docs/ArrayTasksApi.md @@ -7,53 +7,52 @@ All URIs are relative to */v1* | [**getArrayTasksSidebar**](ArrayTasksApi.md#getArrayTasksSidebar) | **GET** /tasks/sidebar | | - + # **getArrayTasksSidebar** > ArrayTaskBrowserSidebar getArrayTasksSidebar(start, end) ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.ArrayTasksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - ArrayTasksApi apiInstance = new ArrayTasksApi(defaultClient); - Integer start = 56; // Integer | Fetch tasks created after this time, unix epoch in seconds, default 7 days ago - Integer end = 56; // Integer | Fetch tasks created before this time, unix epoch in seconds, default now - try { - ArrayTaskBrowserSidebar result = apiInstance.getArrayTasksSidebar(start, end); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ArrayTasksApi#getArrayTasksSidebar"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + ArrayTasksApi apiInstance = new ArrayTasksApi(defaultClient); + Integer start = 56; // Integer | Fetch tasks created after this time, unix epoch in seconds, default 7 days ago + Integer end = 56; // Integer | Fetch tasks created before this time, unix epoch in seconds, default now + try { + ArrayTaskBrowserSidebar result = apiInstance.getArrayTasksSidebar(start, end); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ArrayTasksApi#getArrayTasksSidebar"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -70,7 +69,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/AssetsApi.md b/docs/AssetsApi.md index 3179c76..d89b1b8 100644 --- a/docs/AssetsApi.md +++ b/docs/AssetsApi.md @@ -9,7 +9,7 @@ All URIs are relative to */v1* | [**listPublicAssets**](AssetsApi.md#listPublicAssets) | **GET** /public_assets | | - + # **changeAssetCredentials** > changeAssetCredentials(workspace, teamspace, changeCredentialsRequest) @@ -18,46 +18,45 @@ All URIs are relative to */v1* Changes the access credentials to the given assets ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.AssetsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - AssetsApi apiInstance = new AssetsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - ChangeAssetCredentialsRequest changeCredentialsRequest = new ChangeAssetCredentialsRequest(); // ChangeAssetCredentialsRequest | aws access credentials to store for a namespace - try { - apiInstance.changeAssetCredentials(workspace, teamspace, changeCredentialsRequest); - } catch (ApiException e) { - System.err.println("Exception when calling AssetsApi#changeAssetCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + AssetsApi apiInstance = new AssetsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + ChangeAssetCredentialsRequest changeCredentialsRequest = new ChangeAssetCredentialsRequest(); // ChangeAssetCredentialsRequest | aws access credentials to store for a namespace + try { + apiInstance.changeAssetCredentials(workspace, teamspace, changeCredentialsRequest); + } catch (ApiException e) { + System.err.println("Exception when calling AssetsApi#changeAssetCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -75,7 +74,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -89,7 +88,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listAssets** > AssetListResponse listAssets(workspace, teamspace, assetType, ownershipLevel, depth, search, page, perPage, orderBy, expand) @@ -98,54 +97,53 @@ null (empty response body) List assets in a namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.AssetsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - AssetsApi apiInstance = new AssetsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String assetType = "assetType_example"; // String | asset_type to filter to - String ownershipLevel = "ownershipLevel_example"; // String | ownership_level to filter to (owned, shared) - String depth = "depth_example"; // String | depth of assets to be returned - String search = "search_example"; // String | search string - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String orderBy = "orderBy_example"; // String | order by a specific property, defaults to `created_at desc` supported values are created_at, name, asset_type can also include the order type (asc or desc) separated by space i.e. `name asc` `name desc` etc. - String expand = "expand_example"; // String | expansion option for the AssetInfo object to be added to the response - try { - AssetListResponse result = apiInstance.listAssets(workspace, teamspace, assetType, ownershipLevel, depth, search, page, perPage, orderBy, expand); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AssetsApi#listAssets"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + AssetsApi apiInstance = new AssetsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String assetType = "assetType_example"; // String | asset_type to filter to + String ownershipLevel = "ownershipLevel_example"; // String | ownership_level to filter to (owned, shared) + String depth = "depth_example"; // String | depth of assets to be returned + String search = "search_example"; // String | search string + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String orderBy = "orderBy_example"; // String | order by a specific property, defaults to `created_at desc` supported values are created_at, name, asset_type can also include the order type (asc or desc) separated by space i.e. `name asc` `name desc` etc. + String expand = "expand_example"; // String | expansion option for the AssetInfo object to be added to the response + try { + AssetListResponse result = apiInstance.listAssets(workspace, teamspace, assetType, ownershipLevel, depth, search, page, perPage, orderBy, expand); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AssetsApi#listAssets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -170,7 +168,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -184,7 +182,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listPublicAssets** > AssetListResponse listPublicAssets(assetType, depth, search, page, perPage, orderBy) @@ -193,50 +191,49 @@ public class Example { List public assets ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.AssetsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - AssetsApi apiInstance = new AssetsApi(defaultClient); - String assetType = "assetType_example"; // String | asset_type to filter to - String depth = "depth_example"; // String | depth of assets to be returned - String search = "search_example"; // String | search string - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String orderBy = "orderBy_example"; // String | order by a specific property, defaults to `created_at desc` supported values are created_at, name, asset_type can also include the order type (asc or desc) separated by space i.e. `name asc` `name desc` etc. - try { - AssetListResponse result = apiInstance.listPublicAssets(assetType, depth, search, page, perPage, orderBy); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AssetsApi#listPublicAssets"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + AssetsApi apiInstance = new AssetsApi(defaultClient); + String assetType = "assetType_example"; // String | asset_type to filter to + String depth = "depth_example"; // String | depth of assets to be returned + String search = "search_example"; // String | search string + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String orderBy = "orderBy_example"; // String | order by a specific property, defaults to `created_at desc` supported values are created_at, name, asset_type can also include the order type (asc or desc) separated by space i.e. `name asc` `name desc` etc. + try { + AssetListResponse result = apiInstance.listPublicAssets(assetType, depth, search, page, perPage, orderBy); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AssetsApi#listPublicAssets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -257,7 +254,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/FavoritesApi.md b/docs/FavoritesApi.md index 60b6a6b..20ee437 100644 --- a/docs/FavoritesApi.md +++ b/docs/FavoritesApi.md @@ -26,7 +26,7 @@ All URIs are relative to */v1* | [**listUDFFavoritesUUIDs**](FavoritesApi.md#listUDFFavoritesUUIDs) | **GET** /udfs/favorites/uuids | | - + # **addArrayFavorite** > addArrayFavorite(workspace, teamspace, name) @@ -35,46 +35,45 @@ All URIs are relative to */v1* Add a new array favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the array - try { - apiInstance.addArrayFavorite(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#addArrayFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the array + try { + apiInstance.addArrayFavorite(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#addArrayFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -92,7 +91,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -106,7 +105,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **addMLModelFavorite** > addMLModelFavorite(workspace, teamspace, name) @@ -115,46 +114,45 @@ null (empty response body) Add a new ML model favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the ML model - try { - apiInstance.addMLModelFavorite(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#addMLModelFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the ML model + try { + apiInstance.addMLModelFavorite(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#addMLModelFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -172,7 +170,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -186,7 +184,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **addNotebookFavorite** > addNotebookFavorite(workspace, teamspace, name) @@ -195,46 +193,45 @@ null (empty response body) Add a new notebook favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the notebook - try { - apiInstance.addNotebookFavorite(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#addNotebookFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the notebook + try { + apiInstance.addNotebookFavorite(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#addNotebookFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -252,7 +249,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -266,7 +263,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **addUDFFavorite** > addUDFFavorite(workspace, name) @@ -275,45 +272,44 @@ null (empty response body) Add a new UDF favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the UDF - try { - apiInstance.addUDFFavorite(workspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#addUDFFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the UDF + try { + apiInstance.addUDFFavorite(workspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#addUDFFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -330,7 +326,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -344,7 +340,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteArrayFavorite** > deleteArrayFavorite(workspace, teamspace, name) @@ -353,46 +349,45 @@ null (empty response body) Delete specific array favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the array - try { - apiInstance.deleteArrayFavorite(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#deleteArrayFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the array + try { + apiInstance.deleteArrayFavorite(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#deleteArrayFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -410,7 +405,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -424,7 +419,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteMLModelFavorite** > deleteMLModelFavorite(workspace, teamspace, name) @@ -433,46 +428,45 @@ null (empty response body) Delete specific ML model favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the ML model - try { - apiInstance.deleteMLModelFavorite(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#deleteMLModelFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the ML model + try { + apiInstance.deleteMLModelFavorite(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#deleteMLModelFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -490,7 +484,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -504,7 +498,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteNotebookFavorite** > deleteNotebookFavorite(workspace, teamspace, name) @@ -513,46 +507,45 @@ null (empty response body) Delete specific notebook favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the notebook - try { - apiInstance.deleteNotebookFavorite(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#deleteNotebookFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the notebook + try { + apiInstance.deleteNotebookFavorite(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#deleteNotebookFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -570,7 +563,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -584,7 +577,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteUDFFavorite** > deleteUDFFavorite(workspace, name) @@ -593,45 +586,44 @@ null (empty response body) Delete specific UDF favorite ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the UDF - try { - apiInstance.deleteUDFFavorite(workspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#deleteUDFFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the UDF + try { + apiInstance.deleteUDFFavorite(workspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#deleteUDFFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -648,7 +640,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -662,7 +654,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getArrayFavorite** > ArrayFavorite getArrayFavorite(workspace, teamspace, name) @@ -671,47 +663,46 @@ null (empty response body) Fetch array favorite of a specific array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the array - try { - ArrayFavorite result = apiInstance.getArrayFavorite(workspace, teamspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#getArrayFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the array + try { + ArrayFavorite result = apiInstance.getArrayFavorite(workspace, teamspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#getArrayFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -729,7 +720,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -743,7 +734,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getMLModelFavorite** > MLModelFavorite getMLModelFavorite(workspace, teamspace, name) @@ -752,47 +743,46 @@ public class Example { Fetch ML model favorite of a specific ML model ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the ML model - try { - MLModelFavorite result = apiInstance.getMLModelFavorite(workspace, teamspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#getMLModelFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the ML model + try { + MLModelFavorite result = apiInstance.getMLModelFavorite(workspace, teamspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#getMLModelFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -810,7 +800,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -824,7 +814,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getNotebookFavorite** > NotebookFavorite getNotebookFavorite(workspace, teamspace, name) @@ -833,47 +823,46 @@ public class Example { Fetch notebook favorite of a specific notebook ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | The name of the notebook - try { - NotebookFavorite result = apiInstance.getNotebookFavorite(workspace, teamspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#getNotebookFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String name = "name_example"; // String | The name of the notebook + try { + NotebookFavorite result = apiInstance.getNotebookFavorite(workspace, teamspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#getNotebookFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -891,7 +880,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -905,7 +894,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getUDFFavorite** > UDFFavorite getUDFFavorite(workspace, name) @@ -914,46 +903,45 @@ public class Example { Fetch UDF favorite of a specific UDF ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the UDF - try { - UDFFavorite result = apiInstance.getUDFFavorite(workspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#getUDFFavorite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the UDF + try { + UDFFavorite result = apiInstance.getUDFFavorite(workspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#getUDFFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -970,7 +958,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -984,7 +972,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listArrayFavorites** > ArrayFavoritesData listArrayFavorites(page, perPage) @@ -993,46 +981,45 @@ public class Example { Fetch a page of array favorites of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - ArrayFavoritesData result = apiInstance.listArrayFavorites(page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listArrayFavorites"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + ArrayFavoritesData result = apiInstance.listArrayFavorites(page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listArrayFavorites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1049,7 +1036,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1063,7 +1050,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listArrayFavoritesUUIDs** > List<ArrayFavorite> listArrayFavoritesUUIDs() @@ -1072,44 +1059,43 @@ public class Example { Fetch all favorite array uuids of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - try { - List result = apiInstance.listArrayFavoritesUUIDs(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listArrayFavoritesUUIDs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + try { + List result = apiInstance.listArrayFavoritesUUIDs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listArrayFavoritesUUIDs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1122,7 +1108,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1136,7 +1122,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listMLModelFavorites** > MLModelFavoritesData listMLModelFavorites(page, perPage) @@ -1145,46 +1131,45 @@ This endpoint does not need any parameter. Fetch a page of ML models favorites of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - MLModelFavoritesData result = apiInstance.listMLModelFavorites(page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listMLModelFavorites"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + MLModelFavoritesData result = apiInstance.listMLModelFavorites(page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listMLModelFavorites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1201,7 +1186,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1215,7 +1200,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listMLModelFavoritesUUIDs** > List<MLModelFavorite> listMLModelFavoritesUUIDs() @@ -1224,44 +1209,43 @@ public class Example { Fetch all favorite ML models uuids of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - try { - List result = apiInstance.listMLModelFavoritesUUIDs(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listMLModelFavoritesUUIDs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + try { + List result = apiInstance.listMLModelFavoritesUUIDs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listMLModelFavoritesUUIDs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1274,7 +1258,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1288,7 +1272,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listNotebookFavorites** > NotebookFavoritesData listNotebookFavorites(isDashboard, page, perPage) @@ -1297,47 +1281,46 @@ This endpoint does not need any parameter. Fetch a page of notebook favorites of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - Boolean isDashboard = true; // Boolean | return only dashboards - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - NotebookFavoritesData result = apiInstance.listNotebookFavorites(isDashboard, page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listNotebookFavorites"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + Boolean isDashboard = true; // Boolean | return only dashboards + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + NotebookFavoritesData result = apiInstance.listNotebookFavorites(isDashboard, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listNotebookFavorites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1355,7 +1338,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1369,7 +1352,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listNotebookFavoritesUUIDs** > List<NotebookFavorite> listNotebookFavoritesUUIDs() @@ -1378,44 +1361,43 @@ public class Example { Fetch all favorite notebook uuids of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - try { - List result = apiInstance.listNotebookFavoritesUUIDs(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listNotebookFavoritesUUIDs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + try { + List result = apiInstance.listNotebookFavoritesUUIDs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listNotebookFavoritesUUIDs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1428,7 +1410,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1442,7 +1424,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listUDFFavorites** > UDFFavoritesData listUDFFavorites(page, perPage) @@ -1451,46 +1433,45 @@ This endpoint does not need any parameter. Fetch a page of UDF favorites of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - UDFFavoritesData result = apiInstance.listUDFFavorites(page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listUDFFavorites"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + UDFFavoritesData result = apiInstance.listUDFFavorites(page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listUDFFavorites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1507,7 +1488,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1521,7 +1502,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listUDFFavoritesUUIDs** > List<UDFFavorite> listUDFFavoritesUUIDs() @@ -1530,44 +1511,43 @@ public class Example { Fetch all favorite UDF uuids of connected user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FavoritesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FavoritesApi apiInstance = new FavoritesApi(defaultClient); - try { - List result = apiInstance.listUDFFavoritesUUIDs(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FavoritesApi#listUDFFavoritesUUIDs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FavoritesApi apiInstance = new FavoritesApi(defaultClient); + try { + List result = apiInstance.listUDFFavoritesUUIDs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FavoritesApi#listUDFFavoritesUUIDs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1580,7 +1560,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/FilesApi.md b/docs/FilesApi.md index 966daaa..1809bdb 100644 --- a/docs/FilesApi.md +++ b/docs/FilesApi.md @@ -9,7 +9,7 @@ All URIs are relative to */v1* | [**handleUploadFile**](FilesApi.md#handleUploadFile) | **POST** /files/{workspace}/{teamspace}/upload | | - + # **handleCreateFile** > FileCreated handleCreateFile(workspace, teamspace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME) @@ -18,48 +18,47 @@ All URIs are relative to */v1* Create a tiledb file at the specified location ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FilesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FilesApi apiInstance = new FilesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - FileCreate fileCreate = new FileCreate(); // FileCreate | Input/Output information to create a new TileDB file - String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation - try { - FileCreated result = apiInstance.handleCreateFile(workspace, teamspace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FilesApi#handleCreateFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FilesApi apiInstance = new FilesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + FileCreate fileCreate = new FileCreate(); // FileCreate | Input/Output information to create a new TileDB file + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation + try { + FileCreated result = apiInstance.handleCreateFile(workspace, teamspace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FilesApi#handleCreateFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -78,7 +77,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -92,7 +91,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **handleExportFile** > FileExported handleExportFile(workspace, teamspace, _file, fileExport) @@ -101,48 +100,47 @@ public class Example { Export a TileDB File back to its original file format ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FilesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FilesApi apiInstance = new FilesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String _file = "_file_example"; // String | The file identifier - FileExport fileExport = new FileExport(); // FileExport | Export configuration information - try { - FileExported result = apiInstance.handleExportFile(workspace, teamspace, _file, fileExport); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FilesApi#handleExportFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FilesApi apiInstance = new FilesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String _file = "_file_example"; // String | The file identifier + FileExport fileExport = new FileExport(); // FileExport | Export configuration information + try { + FileExported result = apiInstance.handleExportFile(workspace, teamspace, _file, fileExport); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FilesApi#handleExportFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -161,7 +159,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -175,7 +173,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **handleUploadFile** > FileUploaded handleUploadFile(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name) @@ -184,50 +182,49 @@ public class Example { Upload a tiledb file at the specified location ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.FilesApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - FilesApi apiInstance = new FilesApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - File inputFile = new File("/path/to/file"); // File | the file to upload - String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation - String outputUri = "outputUri_example"; // String | output location of the TileDB File - String name = "name_example"; // String | name to set for registered file - try { - FileUploaded result = apiInstance.handleUploadFile(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling FilesApi#handleUploadFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + FilesApi apiInstance = new FilesApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + File inputFile = new File("/path/to/file"); // File | the file to upload + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation + String outputUri = "outputUri_example"; // String | output location of the TileDB File + String name = "name_example"; // String | name to set for registered file + try { + FileUploaded result = apiInstance.handleUploadFile(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FilesApi#handleUploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -248,7 +245,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/GroupsApi.md b/docs/GroupsApi.md index 2c78fdc..8a31860 100644 --- a/docs/GroupsApi.md +++ b/docs/GroupsApi.md @@ -23,7 +23,7 @@ All URIs are relative to */v1* | [**updateGroup**](GroupsApi.md#updateGroup) | **PATCH** /groups/{workspace}/{teamspace}/{group_name} | | - + # **changeGroupContents** > changeGroupContents(workspace, teamspace, groupName, groupChanges) @@ -32,47 +32,46 @@ All URIs are relative to */v1* Changes the contents of the group by adding/removing members. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - GroupChanges groupChanges = new GroupChanges(); // GroupChanges | - try { - apiInstance.changeGroupContents(workspace, teamspace, groupName, groupChanges); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#changeGroupContents"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + GroupChanges groupChanges = new GroupChanges(); // GroupChanges | + try { + apiInstance.changeGroupContents(workspace, teamspace, groupName, groupChanges); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#changeGroupContents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -91,7 +90,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -105,7 +104,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **createGroup** > createGroup(workspace, teamspace, groupCreate) @@ -114,46 +113,45 @@ null (empty response body) Creates a new group in the namespace. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - GroupCreate groupCreate = new GroupCreate(); // GroupCreate | - try { - apiInstance.createGroup(workspace, teamspace, groupCreate); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#createGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + GroupCreate groupCreate = new GroupCreate(); // GroupCreate | + try { + apiInstance.createGroup(workspace, teamspace, groupCreate); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#createGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -171,7 +169,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -185,7 +183,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteGroup** > deleteGroup(workspace, teamspace, groupName) @@ -194,46 +192,45 @@ null (empty response body) Deletes the group. The assets are not deleted nor are not relocated to any other group ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - try { - apiInstance.deleteGroup(workspace, teamspace, groupName); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#deleteGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + try { + apiInstance.deleteGroup(workspace, teamspace, groupName); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#deleteGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -251,7 +248,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -265,7 +262,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getGroup** > GroupInfo getGroup(workspace, teamspace, groupName) @@ -274,47 +271,46 @@ null (empty response body) Returns the the group ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - try { - GroupInfo result = apiInstance.getGroup(workspace, teamspace, groupName); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#getGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + try { + GroupInfo result = apiInstance.getGroup(workspace, teamspace, groupName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#getGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -332,7 +328,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -346,7 +342,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getGroupActivity** > GroupContentActivityResponse getGroupActivity(workspace, teamspace, groupName, page, perPage) @@ -355,49 +351,48 @@ public class Example { Returns the activity of group content ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - GroupContentActivityResponse result = apiInstance.getGroupActivity(workspace, teamspace, groupName, page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#getGroupActivity"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + GroupContentActivityResponse result = apiInstance.getGroupActivity(workspace, teamspace, groupName, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#getGroupActivity"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -417,7 +412,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -431,7 +426,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getGroupContents** > GroupContents getGroupContents(workspace, teamspace, groupName, page, perPage, namespace, search, orderby, tag, excludeTag, memberType, excludeMemberType) @@ -440,56 +435,55 @@ public class Example { Returns the contents of the group ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - Integer page = 56; // Integer | pagination offset for assets - Integer perPage = 56; // Integer | pagination limit for assets - String namespace = "namespace_example"; // String | namespace to search for - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - List memberType = Arrays.asList(); // List | member type to search for, more than one can be included - List excludeMemberType = Arrays.asList(); // List | member type to exclude matching groups in results, more than one can be included - try { - GroupContents result = apiInstance.getGroupContents(workspace, teamspace, groupName, page, perPage, namespace, search, orderby, tag, excludeTag, memberType, excludeMemberType); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#getGroupContents"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + Integer page = 56; // Integer | pagination offset for assets + Integer perPage = 56; // Integer | pagination limit for assets + String namespace = "namespace_example"; // String | namespace to search for + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + List memberType = Arrays.asList(); // List | member type to search for, more than one can be included + List excludeMemberType = Arrays.asList(); // List | member type to exclude matching groups in results, more than one can be included + try { + GroupContents result = apiInstance.getGroupContents(workspace, teamspace, groupName, page, perPage, namespace, search, orderby, tag, excludeTag, memberType, excludeMemberType); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#getGroupContents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -516,7 +510,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -530,7 +524,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getGroupSharingPolicies** > List<GroupSharing> getGroupSharingPolicies(workspace, teamspace, groupName) @@ -539,47 +533,46 @@ public class Example { Get all sharing details of the group ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - try { - List result = apiInstance.getGroupSharingPolicies(workspace, teamspace, groupName); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#getGroupSharingPolicies"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + try { + List result = apiInstance.getGroupSharingPolicies(workspace, teamspace, groupName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#getGroupSharingPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -597,7 +590,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -612,7 +605,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **groupsBrowserOwnedFiltersGet** > GroupBrowserFilterData groupsBrowserOwnedFiltersGet(namespace) @@ -621,45 +614,44 @@ public class Example { Fetch data to initialize filters for the groups browser ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String namespace = "namespace_example"; // String | namespace - try { - GroupBrowserFilterData result = apiInstance.groupsBrowserOwnedFiltersGet(namespace); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#groupsBrowserOwnedFiltersGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String namespace = "namespace_example"; // String | namespace + try { + GroupBrowserFilterData result = apiInstance.groupsBrowserOwnedFiltersGet(namespace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#groupsBrowserOwnedFiltersGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -675,7 +667,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -689,7 +681,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **groupsBrowserPublicFiltersGet** > GroupBrowserFilterData groupsBrowserPublicFiltersGet() @@ -698,44 +690,43 @@ public class Example { Fetch data to initialize filters for the groups browser ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - try { - GroupBrowserFilterData result = apiInstance.groupsBrowserPublicFiltersGet(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#groupsBrowserPublicFiltersGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + try { + GroupBrowserFilterData result = apiInstance.groupsBrowserPublicFiltersGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#groupsBrowserPublicFiltersGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -748,7 +739,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -762,7 +753,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **groupsBrowserSharedFiltersGet** > GroupBrowserFilterData groupsBrowserSharedFiltersGet(namespace) @@ -771,45 +762,44 @@ This endpoint does not need any parameter. Fetch data to initialize filters for the groups browser ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String namespace = "namespace_example"; // String | namespace - try { - GroupBrowserFilterData result = apiInstance.groupsBrowserSharedFiltersGet(namespace); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#groupsBrowserSharedFiltersGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String namespace = "namespace_example"; // String | namespace + try { + GroupBrowserFilterData result = apiInstance.groupsBrowserSharedFiltersGet(namespace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#groupsBrowserSharedFiltersGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -825,7 +815,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -839,7 +829,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **groupsWorkspaceTeamspaceGroupNameContentsFiltersGet** > GroupContentsFilterData groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(workspace, teamspace, groupName) @@ -848,47 +838,46 @@ public class Example { Fetch data to initialize filters for the group contents ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - try { - GroupContentsFilterData result = apiInstance.groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(workspace, teamspace, groupName); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#groupsWorkspaceTeamspaceGroupNameContentsFiltersGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + try { + GroupContentsFilterData result = apiInstance.groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(workspace, teamspace, groupName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#groupsWorkspaceTeamspaceGroupNameContentsFiltersGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -906,7 +895,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -920,7 +909,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listOwnedGroups** > GroupBrowserData listOwnedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata) @@ -929,56 +918,55 @@ public class Example { Returns one page of owned groups. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String groupType = "groupType_example"; // String | filter by a specific group type - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String namespace = "namespace_example"; // String | namespace - String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name - String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them - String parent = "parent_example"; // String | search only the children of the groups with this uuid - Boolean withMetadata = true; // Boolean | include the metadata of the groups - try { - GroupBrowserData result = apiInstance.listOwnedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#listOwnedGroups"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String groupType = "groupType_example"; // String | filter by a specific group type + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String namespace = "namespace_example"; // String | namespace + String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name + String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them + String parent = "parent_example"; // String | search only the children of the groups with this uuid + Boolean withMetadata = true; // Boolean | include the metadata of the groups + try { + GroupBrowserData result = apiInstance.listOwnedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#listOwnedGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1005,7 +993,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1019,7 +1007,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listPublicGroups** > GroupBrowserData listPublicGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata) @@ -1028,56 +1016,55 @@ public class Example { Returns one page of public groups. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String groupType = "groupType_example"; // String | filter by a specific group type - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String namespace = "namespace_example"; // String | namespace - String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name - String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them - String parent = "parent_example"; // String | search only the children of the groups with this uuid - Boolean withMetadata = true; // Boolean | include the metadata of the groups - try { - GroupBrowserData result = apiInstance.listPublicGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#listPublicGroups"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String groupType = "groupType_example"; // String | filter by a specific group type + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String namespace = "namespace_example"; // String | namespace + String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name + String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them + String parent = "parent_example"; // String | search only the children of the groups with this uuid + Boolean withMetadata = true; // Boolean | include the metadata of the groups + try { + GroupBrowserData result = apiInstance.listPublicGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#listPublicGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1104,7 +1091,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1118,7 +1105,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listSharedGroups** > GroupBrowserData listSharedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, sharedTo, withMetadata) @@ -1127,57 +1114,56 @@ public class Example { Returns one page of shared groups. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String groupType = "groupType_example"; // String | filter by a specific group type - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String namespace = "namespace_example"; // String | namespace - String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name - String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin - List tag = Arrays.asList(); // List | tag to search for, more than one can be included - List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included - Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them - String parent = "parent_example"; // String | search only the children of the groups with this uuid - List sharedTo = Arrays.asList(); // List | namespaces to filter results of where there groups were shared to - Boolean withMetadata = true; // Boolean | include the metadata of the groups - try { - GroupBrowserData result = apiInstance.listSharedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, sharedTo, withMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#listSharedGroups"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String groupType = "groupType_example"; // String | filter by a specific group type + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String namespace = "namespace_example"; // String | namespace + String orderby = "orderby_example"; // String | sort by which field valid values include last_accessed, size, name + String permissions = "permissions_example"; // String | permissions valid values include read, read_write, write, admin + List tag = Arrays.asList(); // List | tag to search for, more than one can be included + List excludeTag = Arrays.asList(); // List | tags to exclude matching array in results, more than one can be included + Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them + String parent = "parent_example"; // String | search only the children of the groups with this uuid + List sharedTo = Arrays.asList(); // List | namespaces to filter results of where there groups were shared to + Boolean withMetadata = true; // Boolean | include the metadata of the groups + try { + GroupBrowserData result = apiInstance.listSharedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, sharedTo, withMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#listSharedGroups"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1205,7 +1191,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1219,7 +1205,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **registerGroup** > registerGroup(workspace, teamspace, array, groupRegister) @@ -1228,47 +1214,46 @@ public class Example { Registers an existing group in the namespace. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | The unique name or id of the group - GroupRegister groupRegister = new GroupRegister(); // GroupRegister | - try { - apiInstance.registerGroup(workspace, teamspace, array, groupRegister); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#registerGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | The unique name or id of the group + GroupRegister groupRegister = new GroupRegister(); // GroupRegister | + try { + apiInstance.registerGroup(workspace, teamspace, array, groupRegister); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#registerGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1287,7 +1272,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1301,7 +1286,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shareGroup** > shareGroup(workspace, teamspace, groupName, groupSharingRequest) @@ -1310,47 +1295,46 @@ null (empty response body) Share a group with a namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - GroupSharingRequest groupSharingRequest = new GroupSharingRequest(); // GroupSharingRequest | Namespace and list of permissions to share with. Sharing is recursive, it is applied to all reachable subgroups and arrays of the group. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the group will not be shared with the namespace at all. - try { - apiInstance.shareGroup(workspace, teamspace, groupName, groupSharingRequest); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#shareGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + GroupSharingRequest groupSharingRequest = new GroupSharingRequest(); // GroupSharingRequest | Namespace and list of permissions to share with. Sharing is recursive, it is applied to all reachable subgroups and arrays of the group. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the group will not be shared with the namespace at all. + try { + apiInstance.shareGroup(workspace, teamspace, groupName, groupSharingRequest); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#shareGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1369,7 +1353,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1384,7 +1368,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateGroup** > updateGroup(workspace, teamspace, groupName, groupUpdate) @@ -1393,47 +1377,46 @@ null (empty response body) Changes attributes of the group ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.GroupsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - GroupsApi apiInstance = new GroupsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String groupName = "groupName_example"; // String | The unique name or id of the group - GroupUpdate groupUpdate = new GroupUpdate(); // GroupUpdate | - try { - apiInstance.updateGroup(workspace, teamspace, groupName, groupUpdate); - } catch (ApiException e) { - System.err.println("Exception when calling GroupsApi#updateGroup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + GroupsApi apiInstance = new GroupsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String groupName = "groupName_example"; // String | The unique name or id of the group + GroupUpdate groupUpdate = new GroupUpdate(); // GroupUpdate | + try { + apiInstance.updateGroup(workspace, teamspace, groupName, groupUpdate); + } catch (ApiException e) { + System.err.println("Exception when calling GroupsApi#updateGroup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1452,7 +1435,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/InvitationApi.md b/docs/InvitationApi.md index 9beb396..ad5ec0e 100644 --- a/docs/InvitationApi.md +++ b/docs/InvitationApi.md @@ -16,7 +16,7 @@ All URIs are relative to */v1* | [**sharePayment**](InvitationApi.md#sharePayment) | **POST** /invitations/share_payment/{workspace}/{teamspace} | | - + # **acceptInvitation** > acceptInvitation(invitation) @@ -25,44 +25,43 @@ All URIs are relative to */v1* Accepts invitation ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String invitation = "invitation_example"; // String | the ID of invitation about to be accepted - try { - apiInstance.acceptInvitation(invitation); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#acceptInvitation"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String invitation = "invitation_example"; // String | the ID of invitation about to be accepted + try { + apiInstance.acceptInvitation(invitation); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#acceptInvitation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -78,7 +77,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -93,7 +92,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **cancelJoinOrganization** > cancelJoinOrganization(invitation, organization) @@ -102,45 +101,44 @@ null (empty response body) Cancels join organization invitation ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String invitation = "invitation_example"; // String | the ID of invitation about to be cancelled - String organization = "organization_example"; // String | name or UUID of organization - try { - apiInstance.cancelJoinOrganization(invitation, organization); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#cancelJoinOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String invitation = "invitation_example"; // String | the ID of invitation about to be cancelled + String organization = "organization_example"; // String | name or UUID of organization + try { + apiInstance.cancelJoinOrganization(invitation, organization); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#cancelJoinOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -157,7 +155,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -172,7 +170,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **cancelShareArrayByInvite** > cancelShareArrayByInvite(workspace, teamspace, invitation, array) @@ -181,47 +179,46 @@ null (empty response body) Cancels array sharing invitation ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String invitation = "invitation_example"; // String | the ID of invitation about to be cancelled - String array = "array_example"; // String | name/uri of array that is url-encoded - try { - apiInstance.cancelShareArrayByInvite(workspace, teamspace, invitation, array); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#cancelShareArrayByInvite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String invitation = "invitation_example"; // String | the ID of invitation about to be cancelled + String array = "array_example"; // String | name/uri of array that is url-encoded + try { + apiInstance.cancelShareArrayByInvite(workspace, teamspace, invitation, array); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#cancelShareArrayByInvite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -240,7 +237,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -255,7 +252,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **cancelShareGroupByInvite** > cancelShareGroupByInvite(workspace, teamspace, invitation, groupName) @@ -264,47 +261,46 @@ null (empty response body) Cancels group sharing invitation ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String invitation = "invitation_example"; // String | the ID of invitation about to be cancelled - String groupName = "groupName_example"; // String | name/uuid of group that is url-encoded - try { - apiInstance.cancelShareGroupByInvite(workspace, teamspace, invitation, groupName); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#cancelShareGroupByInvite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String invitation = "invitation_example"; // String | the ID of invitation about to be cancelled + String groupName = "groupName_example"; // String | name/uuid of group that is url-encoded + try { + apiInstance.cancelShareGroupByInvite(workspace, teamspace, invitation, groupName); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#cancelShareGroupByInvite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -323,7 +319,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -338,7 +334,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **cancelSharePayment** > cancelSharePayment(workspace, teamspace, target) @@ -347,46 +343,45 @@ null (empty response body) Revokes invitation from the source namespace to the target. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String target = "target_example"; // String | name or UUID of recipient namespace - try { - apiInstance.cancelSharePayment(workspace, teamspace, target); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#cancelSharePayment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String target = "target_example"; // String | name or UUID of recipient namespace + try { + apiInstance.cancelSharePayment(workspace, teamspace, target); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#cancelSharePayment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -404,7 +399,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -418,7 +413,7 @@ null (empty response body) | **404** | No invitation was found to cancel | - | | **0** | error response | - | - + # **fetchInvitations** > InvitationData fetchInvitations(organization, array, group, start, end, page, perPage, type, status, orderby) @@ -427,54 +422,53 @@ null (empty response body) Fetch a list of invitations ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String organization = "organization_example"; // String | name or ID of organization to filter - String array = "array_example"; // String | name/uri of array that is url-encoded to filter - String group = "group_example"; // String | name or ID of group to filter - Integer start = 56; // Integer | start time for tasks to filter by - Integer end = 56; // Integer | end time for tasks to filter by - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String type = "type_example"; // String | invitation type, \"ARRAY_SHARE\", \"JOIN_ORGANIZATION\" - String status = "status_example"; // String | Filter to only return \"PENDING\", \"ACCEPTED\" - String orderby = "orderby_example"; // String | sort by which field valid values include timestamp, array_name, organization_name - try { - InvitationData result = apiInstance.fetchInvitations(organization, array, group, start, end, page, perPage, type, status, orderby); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#fetchInvitations"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String organization = "organization_example"; // String | name or ID of organization to filter + String array = "array_example"; // String | name/uri of array that is url-encoded to filter + String group = "group_example"; // String | name or ID of group to filter + Integer start = 56; // Integer | start time for tasks to filter by + Integer end = 56; // Integer | end time for tasks to filter by + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String type = "type_example"; // String | invitation type, \"ARRAY_SHARE\", \"JOIN_ORGANIZATION\" + String status = "status_example"; // String | Filter to only return \"PENDING\", \"ACCEPTED\" + String orderby = "orderby_example"; // String | sort by which field valid values include timestamp, array_name, organization_name + try { + InvitationData result = apiInstance.fetchInvitations(organization, array, group, start, end, page, perPage, type, status, orderby); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#fetchInvitations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -499,7 +493,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -513,7 +507,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **joinOrganization** > joinOrganization(organization, emailInvite) @@ -522,45 +516,44 @@ public class Example { Sends email to multiple recipients with joining information regarding an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String organization = "organization_example"; // String | name or UUID of organization - InvitationOrganizationJoinEmail emailInvite = new InvitationOrganizationJoinEmail(); // InvitationOrganizationJoinEmail | list of email recipients - try { - apiInstance.joinOrganization(organization, emailInvite); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#joinOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String organization = "organization_example"; // String | name or UUID of organization + InvitationOrganizationJoinEmail emailInvite = new InvitationOrganizationJoinEmail(); // InvitationOrganizationJoinEmail | list of email recipients + try { + apiInstance.joinOrganization(organization, emailInvite); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#joinOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -577,7 +570,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -593,7 +586,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shareArrayByInvite** > shareArrayByInvite(workspace, teamspace, array, emailInvite) @@ -602,47 +595,46 @@ null (empty response body) Sends email to multiple recipients with sharing information regarding an array ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - InvitationArrayShareEmail emailInvite = new InvitationArrayShareEmail(); // InvitationArrayShareEmail | list of email recipients - try { - apiInstance.shareArrayByInvite(workspace, teamspace, array, emailInvite); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#shareArrayByInvite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + InvitationArrayShareEmail emailInvite = new InvitationArrayShareEmail(); // InvitationArrayShareEmail | list of email recipients + try { + apiInstance.shareArrayByInvite(workspace, teamspace, array, emailInvite); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#shareArrayByInvite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -661,7 +653,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -677,7 +669,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shareGroupByInvite** > shareGroupByInvite(workspace, teamspace, group, emailInvite) @@ -686,47 +678,46 @@ null (empty response body) Sends email to multiple recipients with sharing information regarding a group ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String group = "group_example"; // String | name/uri of group that is url-encoded - InvitationGroupShareEmail emailInvite = new InvitationGroupShareEmail(); // InvitationGroupShareEmail | list of email/namespace recipients - try { - apiInstance.shareGroupByInvite(workspace, teamspace, group, emailInvite); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#shareGroupByInvite"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String group = "group_example"; // String | name/uri of group that is url-encoded + InvitationGroupShareEmail emailInvite = new InvitationGroupShareEmail(); // InvitationGroupShareEmail | list of email/namespace recipients + try { + apiInstance.shareGroupByInvite(workspace, teamspace, group, emailInvite); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#shareGroupByInvite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -745,7 +736,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -761,7 +752,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **sharePayment** > sharePayment(workspace, teamspace, emailInvite) @@ -770,46 +761,45 @@ null (empty response body) Sends email to multiple recipients allowing them to use the payment instrument provided by the source namespace. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.InvitationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - InvitationApi apiInstance = new InvitationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - SharePaymentRequest emailInvite = new SharePaymentRequest(); // SharePaymentRequest | Recipients of the invitation. These may only be namespaces, not email addresses. - try { - apiInstance.sharePayment(workspace, teamspace, emailInvite); - } catch (ApiException e) { - System.err.println("Exception when calling InvitationApi#sharePayment"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + InvitationApi apiInstance = new InvitationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + SharePaymentRequest emailInvite = new SharePaymentRequest(); // SharePaymentRequest | Recipients of the invitation. These may only be namespaces, not email addresses. + try { + apiInstance.sharePayment(workspace, teamspace, emailInvite); + } catch (ApiException e) { + System.err.println("Exception when calling InvitationApi#sharePayment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -827,7 +817,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/NotebookApi.md b/docs/NotebookApi.md index 9d06b79..fffa49e 100644 --- a/docs/NotebookApi.md +++ b/docs/NotebookApi.md @@ -11,7 +11,7 @@ All URIs are relative to */v1* | [**updateNotebookName**](NotebookApi.md#updateNotebookName) | **PATCH** /notebooks/{workspace}/{teamspace}/{array}/rename | | - + # **getNotebookServerStatus** > NotebookStatus getNotebookServerStatus(workspace, teamspace) @@ -20,46 +20,45 @@ All URIs are relative to */v1* Get status of the notebook server ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebookApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebookApi apiInstance = new NotebookApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - try { - NotebookStatus result = apiInstance.getNotebookServerStatus(workspace, teamspace); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling NotebookApi#getNotebookServerStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebookApi apiInstance = new NotebookApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + try { + NotebookStatus result = apiInstance.getNotebookServerStatus(workspace, teamspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotebookApi#getNotebookServerStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -76,7 +75,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -92,7 +91,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **handleCopyNotebook** > NotebookCopied handleCopyNotebook(workspace, teamspace, array, notebookCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp) @@ -101,50 +100,49 @@ public class Example { Copy a tiledb notebook at the specified location ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebookApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebookApi apiInstance = new NotebookApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | The name of the notebook - NotebookCopy notebookCopy = new NotebookCopy(); // NotebookCopy | Input/Output information to create a new TileDB file - String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation - Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch, copy will use open_at functionality to copy notebook created at the specific timestamp - try { - NotebookCopied result = apiInstance.handleCopyNotebook(workspace, teamspace, array, notebookCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling NotebookApi#handleCopyNotebook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebookApi apiInstance = new NotebookApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | The name of the notebook + NotebookCopy notebookCopy = new NotebookCopy(); // NotebookCopy | Input/Output information to create a new TileDB file + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation + Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch, copy will use open_at functionality to copy notebook created at the specific timestamp + try { + NotebookCopied result = apiInstance.handleCopyNotebook(workspace, teamspace, array, notebookCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotebookApi#handleCopyNotebook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -165,7 +163,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -179,7 +177,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **handleUploadNotebook** > FileUploaded handleUploadNotebook(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name) @@ -188,50 +186,49 @@ public class Example { Upload a notebook at the specified location ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebookApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebookApi apiInstance = new NotebookApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - File inputFile = new File("/path/to/file"); // File | the notebook to upload - String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation - String outputUri = "outputUri_example"; // String | output location of the TileDB File - String name = "name_example"; // String | name to set for registered file - try { - FileUploaded result = apiInstance.handleUploadNotebook(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling NotebookApi#handleUploadNotebook"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebookApi apiInstance = new NotebookApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + File inputFile = new File("/path/to/file"); // File | the notebook to upload + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation + String outputUri = "outputUri_example"; // String | output location of the TileDB File + String name = "name_example"; // String | name to set for registered file + try { + FileUploaded result = apiInstance.handleUploadNotebook(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotebookApi#handleUploadNotebook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -252,7 +249,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -266,7 +263,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shutdownNotebookServer** > shutdownNotebookServer(workspace, teamspace) @@ -275,45 +272,44 @@ public class Example { Shutdown a notebook server ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebookApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebookApi apiInstance = new NotebookApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - try { - apiInstance.shutdownNotebookServer(workspace, teamspace); - } catch (ApiException e) { - System.err.println("Exception when calling NotebookApi#shutdownNotebookServer"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebookApi apiInstance = new NotebookApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + try { + apiInstance.shutdownNotebookServer(workspace, teamspace); + } catch (ApiException e) { + System.err.println("Exception when calling NotebookApi#shutdownNotebookServer"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -330,7 +326,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -345,7 +341,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateNotebookName** > updateNotebookName(workspace, teamspace, array, notebookMetadata) @@ -354,47 +350,46 @@ null (empty response body) update name on a notebok, moving related S3 object to new location ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebookApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebookApi apiInstance = new NotebookApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of notebook (array) that is url-encoded - ArrayInfoUpdate notebookMetadata = new ArrayInfoUpdate(); // ArrayInfoUpdate | notebook (array) metadata to update - try { - apiInstance.updateNotebookName(workspace, teamspace, array, notebookMetadata); - } catch (ApiException e) { - System.err.println("Exception when calling NotebookApi#updateNotebookName"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebookApi apiInstance = new NotebookApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of notebook (array) that is url-encoded + ArrayInfoUpdate notebookMetadata = new ArrayInfoUpdate(); // ArrayInfoUpdate | notebook (array) metadata to update + try { + apiInstance.updateNotebookName(workspace, teamspace, array, notebookMetadata); + } catch (ApiException e) { + System.err.println("Exception when calling NotebookApi#updateNotebookName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -413,7 +408,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/NotebooksApi.md b/docs/NotebooksApi.md index c84091a..d4b401b 100644 --- a/docs/NotebooksApi.md +++ b/docs/NotebooksApi.md @@ -8,7 +8,7 @@ All URIs are relative to */v1* | [**notebooksWorkspaceTeamspaceArrayPrunePost**](NotebooksApi.md#notebooksWorkspaceTeamspaceArrayPrunePost) | **POST** /notebooks/{workspace}/{teamspace}/{array}/prune | | - + # **notebooksWorkspaceTeamspaceArrayEndTimestampsGet** > ArrayEndTimestampData notebooksWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage) @@ -17,49 +17,48 @@ All URIs are relative to */v1* retrieve a list of timestamps from the array fragment info listing in milliseconds, paginated ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebooksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebooksApi apiInstance = new NotebooksApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - ArrayEndTimestampData result = apiInstance.notebooksWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling NotebooksApi#notebooksWorkspaceTeamspaceArrayEndTimestampsGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebooksApi apiInstance = new NotebooksApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + ArrayEndTimestampData result = apiInstance.notebooksWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotebooksApi#notebooksWorkspaceTeamspaceArrayEndTimestampsGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -79,7 +78,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -93,7 +92,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **notebooksWorkspaceTeamspaceArrayPrunePost** > notebooksWorkspaceTeamspaceArrayPrunePost(workspace, teamspace, array, keepVersions) @@ -102,47 +101,46 @@ public class Example { prune fragments of the notebook ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.NotebooksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - NotebooksApi apiInstance = new NotebooksApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer keepVersions = 56; // Integer | The number of most recents fragment to preserve - try { - apiInstance.notebooksWorkspaceTeamspaceArrayPrunePost(workspace, teamspace, array, keepVersions); - } catch (ApiException e) { - System.err.println("Exception when calling NotebooksApi#notebooksWorkspaceTeamspaceArrayPrunePost"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + NotebooksApi apiInstance = new NotebooksApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer keepVersions = 56; // Integer | The number of most recents fragment to preserve + try { + apiInstance.notebooksWorkspaceTeamspaceArrayPrunePost(workspace, teamspace, array, keepVersions); + } catch (ApiException e) { + System.err.println("Exception when calling NotebooksApi#notebooksWorkspaceTeamspaceArrayPrunePost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -161,7 +159,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/OrganizationApi.md b/docs/OrganizationApi.md index bd366bb..5fc979e 100644 --- a/docs/OrganizationApi.md +++ b/docs/OrganizationApi.md @@ -26,7 +26,7 @@ All URIs are relative to */v1* | [**updateUserInOrganization**](OrganizationApi.md#updateUserInOrganization) | **PATCH** /organizations/{organization}/{username} | | - + # **addAWSAccessCredentials** > addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials) @@ -35,46 +35,45 @@ All URIs are relative to */v1* Add aws keys ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws access credentials to store for a namespace - try { - apiInstance.addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#addAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws access credentials to store for a namespace + try { + apiInstance.addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#addAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -83,7 +82,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **awsAccessCredentials** | [**AWSAccessCredentials**](AWSAccessCredentials.md)| aws access credentials to store for a namespace | | ### Return type @@ -92,7 +91,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -106,7 +105,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **addUserToOrganization** > addUserToOrganization(organization, user) @@ -115,45 +114,44 @@ null (empty response body) add a user to an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - OrganizationUser user = new OrganizationUser(); // OrganizationUser | user to add - try { - apiInstance.addUserToOrganization(organization, user); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#addUserToOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + OrganizationUser user = new OrganizationUser(); // OrganizationUser | user to add + try { + apiInstance.addUserToOrganization(organization, user); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#addUserToOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -170,7 +168,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -184,7 +182,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **checkAWSAccessCredentials** > List<AWSAccessCredentials> checkAWSAccessCredentials(workspace, teamspace) @@ -193,46 +191,45 @@ null (empty response body) Check if aws keys are set ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - try { - List result = apiInstance.checkAWSAccessCredentials(workspace, teamspace); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#checkAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + try { + List result = apiInstance.checkAWSAccessCredentials(workspace, teamspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#checkAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -241,7 +238,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | ### Return type @@ -249,7 +246,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -263,7 +260,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **checkAWSAccessCredentialsByName** > AWSAccessCredentials checkAWSAccessCredentialsByName(workspace, teamspace, name) @@ -272,47 +269,46 @@ public class Example { Check if aws keys are set by name ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | name - try { - AWSAccessCredentials result = apiInstance.checkAWSAccessCredentialsByName(workspace, teamspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#checkAWSAccessCredentialsByName"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + String name = "name_example"; // String | name + try { + AWSAccessCredentials result = apiInstance.checkAWSAccessCredentialsByName(workspace, teamspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#checkAWSAccessCredentialsByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -321,7 +317,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **name** | **String**| name | | ### Return type @@ -330,7 +326,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -344,7 +340,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **checkSSODomain** > DomainCheckResult checkSSODomain(organization, uuid) @@ -353,46 +349,45 @@ public class Example { Immediately verify ownership of the specified SSO domain ownership claim. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String uuid = "uuid_example"; // String | configuration ID - try { - DomainCheckResult result = apiInstance.checkSSODomain(organization, uuid); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#checkSSODomain"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String uuid = "uuid_example"; // String | configuration ID + try { + DomainCheckResult result = apiInstance.checkSSODomain(organization, uuid); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#checkSSODomain"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -409,7 +404,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -422,7 +417,7 @@ public class Example { | **200** | The check executed. Detailed results are available in the response. | - | | **0** | error response | - | - + # **createOrganization** > createOrganization(organization) @@ -431,44 +426,43 @@ public class Example { create a organization, the user creating will be listed as owner ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - Organization organization = new Organization(); // Organization | organization to create - try { - apiInstance.createOrganization(organization); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#createOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + Organization organization = new Organization(); // Organization | organization to create + try { + apiInstance.createOrganization(organization); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#createOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -484,7 +478,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -498,7 +492,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **createSSODomain** > SSODomainConfig createSSODomain(organization, config) @@ -507,46 +501,45 @@ null (empty response body) Create a new SSO connection that connects this organization to this domain. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - SSODomainConfig config = new SSODomainConfig(); // SSODomainConfig | The SSO connection to create. - try { - SSODomainConfig result = apiInstance.createSSODomain(organization, config); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#createSSODomain"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + SSODomainConfig config = new SSODomainConfig(); // SSODomainConfig | The SSO connection to create. + try { + SSODomainConfig result = apiInstance.createSSODomain(organization, config); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#createSSODomain"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -563,7 +556,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -576,7 +569,7 @@ public class Example { | **200** | Claim created successfully. | - | | **0** | error response | - | - + # **deleteAWSAccessCredentials** > deleteAWSAccessCredentials(workspace, teamspace, name) @@ -585,46 +578,45 @@ public class Example { delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | name - try { - apiInstance.deleteAWSAccessCredentials(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#deleteAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + String name = "name_example"; // String | name + try { + apiInstance.deleteAWSAccessCredentials(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#deleteAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -633,7 +625,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **name** | **String**| name | | ### Return type @@ -642,7 +634,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -656,7 +648,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteOrganization** > deleteOrganization(organization) @@ -665,44 +657,43 @@ null (empty response body) delete a organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name or ID - try { - apiInstance.deleteOrganization(organization); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#deleteOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name or ID + try { + apiInstance.deleteOrganization(organization); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#deleteOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -718,7 +709,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -732,7 +723,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteSSODomain** > deleteSSODomain(organization, uuid) @@ -741,45 +732,44 @@ null (empty response body) Deletes the configuration for the given SSO connection. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String uuid = "uuid_example"; // String | configuration ID - try { - apiInstance.deleteSSODomain(organization, uuid); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#deleteSSODomain"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String uuid = "uuid_example"; // String | configuration ID + try { + apiInstance.deleteSSODomain(organization, uuid); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#deleteSSODomain"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -796,7 +786,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -809,7 +799,7 @@ null (empty response body) | **204** | Deletion successful. | - | | **0** | error response | - | - + # **deleteUserFromOrganization** > deleteUserFromOrganization(organization, username) @@ -818,45 +808,44 @@ null (empty response body) delete a user from an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String username = "username_example"; // String | username to manipulate - try { - apiInstance.deleteUserFromOrganization(organization, username); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#deleteUserFromOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String username = "username_example"; // String | username to manipulate + try { + apiInstance.deleteUserFromOrganization(organization, username); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#deleteUserFromOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -873,7 +862,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -887,7 +876,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getAllOrganizations** > List<Organization> getAllOrganizations() @@ -896,44 +885,43 @@ null (empty response body) get all organizations that the user is member of ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - try { - List result = apiInstance.getAllOrganizations(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#getAllOrganizations"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + try { + List result = apiInstance.getAllOrganizations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getAllOrganizations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -946,7 +934,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -962,7 +950,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getOrganization** > Organization getOrganization(organization) @@ -971,45 +959,44 @@ This endpoint does not need any parameter. get a organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name or ID - try { - Organization result = apiInstance.getOrganization(organization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#getOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name or ID + try { + Organization result = apiInstance.getOrganization(organization); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1025,7 +1012,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1040,7 +1027,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getOrganizationUser** > OrganizationUser getOrganizationUser(organization, username) @@ -1049,46 +1036,45 @@ public class Example { get a user from an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String username = "username_example"; // String | username to manipulate - try { - OrganizationUser result = apiInstance.getOrganizationUser(organization, username); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#getOrganizationUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String username = "username_example"; // String | username to manipulate + try { + OrganizationUser result = apiInstance.getOrganizationUser(organization, username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getOrganizationUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1105,7 +1091,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1120,7 +1106,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getSSODomain** > SSODomainConfig getSSODomain(organization, uuid) @@ -1129,46 +1115,45 @@ public class Example { Gets details about the given SSO domain connection. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String uuid = "uuid_example"; // String | configuration ID - try { - SSODomainConfig result = apiInstance.getSSODomain(organization, uuid); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#getSSODomain"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String uuid = "uuid_example"; // String | configuration ID + try { + SSODomainConfig result = apiInstance.getSSODomain(organization, uuid); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getSSODomain"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1185,7 +1170,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1198,7 +1183,7 @@ public class Example { | **200** | The details about this domain connection. | - | | **0** | error response | - | - + # **getSSODomains** > SSODomainConfigResponse getSSODomains(organization) @@ -1207,45 +1192,44 @@ public class Example { Lists all the SSO connections associated with the given organization. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - try { - SSODomainConfigResponse result = apiInstance.getSSODomains(organization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#getSSODomains"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + try { + SSODomainConfigResponse result = apiInstance.getSSODomains(organization); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getSSODomains"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1261,7 +1245,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1274,7 +1258,7 @@ public class Example { | **200** | The SSO domains associated with the org. | - | | **0** | error response | - | - + # **updateAWSAccessCredentials** > updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials) @@ -1283,47 +1267,46 @@ public class Example { Update aws keys or associated buckets. This will update the key associations for each array in the namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | name - AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws credentials to update - try { - apiInstance.updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#updateAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + String name = "name_example"; // String | name + AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws credentials to update + try { + apiInstance.updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#updateAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1332,7 +1315,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **name** | **String**| name | | | **awsAccessCredentials** | [**AWSAccessCredentials**](AWSAccessCredentials.md)| aws credentials to update | | @@ -1342,7 +1325,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1356,7 +1339,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateOrganization** > updateOrganization(organization, organizationDetails) @@ -1365,45 +1348,44 @@ null (empty response body) update a organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name or ID - OrganizationUpdate organizationDetails = new OrganizationUpdate(); // OrganizationUpdate | organization details to update - try { - apiInstance.updateOrganization(organization, organizationDetails); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#updateOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name or ID + OrganizationUpdate organizationDetails = new OrganizationUpdate(); // OrganizationUpdate | organization details to update + try { + apiInstance.updateOrganization(organization, organizationDetails); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#updateOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1420,7 +1402,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1434,7 +1416,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateSSODomain** > SSODomainConfig updateSSODomain(organization, uuid, config) @@ -1443,47 +1425,46 @@ null (empty response body) Updates the configuration for the given SSO connection. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String uuid = "uuid_example"; // String | configuration ID - SSODomainConfig config = new SSODomainConfig(); // SSODomainConfig | The changes to make to the configuration. - try { - SSODomainConfig result = apiInstance.updateSSODomain(organization, uuid, config); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#updateSSODomain"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String uuid = "uuid_example"; // String | configuration ID + SSODomainConfig config = new SSODomainConfig(); // SSODomainConfig | The changes to make to the configuration. + try { + SSODomainConfig result = apiInstance.updateSSODomain(organization, uuid, config); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#updateSSODomain"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1501,7 +1482,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1514,7 +1495,7 @@ public class Example { | **200** | The updated details about the SSO connection. | - | | **0** | error response | - | - + # **updateUserInOrganization** > updateUserInOrganization(organization, username, user) @@ -1523,46 +1504,45 @@ public class Example { update a user in an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.OrganizationApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - OrganizationApi apiInstance = new OrganizationApi(defaultClient); - String organization = "organization_example"; // String | organization name - String username = "username_example"; // String | username to manipulate - OrganizationUser user = new OrganizationUser(); // OrganizationUser | user details to update - try { - apiInstance.updateUserInOrganization(organization, username, user); - } catch (ApiException e) { - System.err.println("Exception when calling OrganizationApi#updateUserInOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + OrganizationApi apiInstance = new OrganizationApi(defaultClient); + String organization = "organization_example"; // String | organization name + String username = "username_example"; // String | username to manipulate + OrganizationUser user = new OrganizationUser(); // OrganizationUser | user details to update + try { + apiInstance.updateUserInOrganization(organization, username, user); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#updateUserInOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1580,7 +1560,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/QueryApi.md b/docs/QueryApi.md index 1cc25e3..b4159db 100644 --- a/docs/QueryApi.md +++ b/docs/QueryApi.md @@ -11,7 +11,7 @@ All URIs are relative to */v1* | [**submitQueryJson**](QueryApi.md#submitQueryJson) | **POST** /arrays/{workspace}/{teamspace}/{array}/query/submit_query_json | | - + # **finalizeQuery** > Query finalizeQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt) @@ -20,52 +20,51 @@ All URIs are relative to */v1* send a query to run against a specified array/URI registered to a group/project ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.QueryApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - QueryApi apiInstance = new QueryApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String type = "type_example"; // String | type of query - String contentType = "application/json"; // String | Content Type of input and return mime - Query query = new Query(); // Query | query to run - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - Integer openAt = 56; // Integer | open_at for array in unix epoch - try { - Query result = apiInstance.finalizeQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling QueryApi#finalizeQuery"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + QueryApi apiInstance = new QueryApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String type = "type_example"; // String | type of query + String contentType = "application/json"; // String | Content Type of input and return mime + Query query = new Query(); // Query | query to run + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + Integer openAt = 56; // Integer | open_at for array in unix epoch + try { + Query result = apiInstance.finalizeQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#finalizeQuery"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -88,7 +87,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -103,7 +102,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getEstResultSizes** > Query getEstResultSizes(workspace, teamspace, array, type, contentType, query, xPayer, openAt) @@ -112,52 +111,51 @@ public class Example { send a query to run against a specified array/URI registered to a group/project ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.QueryApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - QueryApi apiInstance = new QueryApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String type = "type_example"; // String | type of query - String contentType = "application/json"; // String | Content Type of input and return mime - Query query = new Query(); // Query | query to run - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - Integer openAt = 56; // Integer | open_at for array in unix epoch - try { - Query result = apiInstance.getEstResultSizes(workspace, teamspace, array, type, contentType, query, xPayer, openAt); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling QueryApi#getEstResultSizes"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + QueryApi apiInstance = new QueryApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String type = "type_example"; // String | type of query + String contentType = "application/json"; // String | Content Type of input and return mime + Query query = new Query(); // Query | query to run + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + Integer openAt = 56; // Integer | open_at for array in unix epoch + try { + Query result = apiInstance.getEstResultSizes(workspace, teamspace, array, type, contentType, query, xPayer, openAt); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#getEstResultSizes"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -180,7 +178,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -195,7 +193,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getFile** > File getFile(workspace, teamspace, array, contentType, xPayer) @@ -204,49 +202,48 @@ public class Example { send a query to run against a specified array/URI registered to a group/project, returns file bytes ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.QueryApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - QueryApi apiInstance = new QueryApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - try { - File result = apiInstance.getFile(workspace, teamspace, array, contentType, xPayer); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling QueryApi#getFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + QueryApi apiInstance = new QueryApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + try { + File result = apiInstance.getFile(workspace, teamspace, array, contentType, xPayer); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#getFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -266,7 +263,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -280,7 +277,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **submitQuery** > Query submitQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt) @@ -289,52 +286,51 @@ public class Example { send a query to run against a specified array/URI registered to a group/project ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.QueryApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - QueryApi apiInstance = new QueryApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String type = "type_example"; // String | type of query - String contentType = "application/json"; // String | Content Type of input and return mime - Query query = new Query(); // Query | query to run - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - Integer openAt = 56; // Integer | open_at for array in unix epoch - try { - Query result = apiInstance.submitQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling QueryApi#submitQuery"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + QueryApi apiInstance = new QueryApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String type = "type_example"; // String | type of query + String contentType = "application/json"; // String | Content Type of input and return mime + Query query = new Query(); // Query | query to run + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + Integer openAt = 56; // Integer | open_at for array in unix epoch + try { + Query result = apiInstance.submitQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#submitQuery"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -357,7 +353,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -372,7 +368,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **submitQueryJson** > Object submitQueryJson(workspace, teamspace, array, contentType, queryJson, xPayer) @@ -381,50 +377,49 @@ public class Example { send a query to run against a specified array/URI registered to a group/project, returns JSON results ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.QueryApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - QueryApi apiInstance = new QueryApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - String contentType = "application/json"; // String | Content Type of input and return mime - QueryJson queryJson = new QueryJson(); // QueryJson | query to run - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - try { - Object result = apiInstance.submitQueryJson(workspace, teamspace, array, contentType, queryJson, xPayer); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling QueryApi#submitQueryJson"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + QueryApi apiInstance = new QueryApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + String contentType = "application/json"; // String | Content Type of input and return mime + QueryJson queryJson = new QueryJson(); // QueryJson | query to run + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + try { + Object result = apiInstance.submitQueryJson(workspace, teamspace, array, contentType, queryJson, xPayer); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#submitQueryJson"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -445,7 +440,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/RegisteredTaskGraphsApi.md b/docs/RegisteredTaskGraphsApi.md index 17b1ca5..f95d794 100644 --- a/docs/RegisteredTaskGraphsApi.md +++ b/docs/RegisteredTaskGraphsApi.md @@ -12,7 +12,7 @@ All URIs are relative to */v1* | [**updateRegisteredTaskGraph**](RegisteredTaskGraphsApi.md#updateRegisteredTaskGraph) | **PATCH** /taskgraphs/{workspace}/registered/{name} | | - + # **deleteRegisteredTaskGraph** > deleteRegisteredTaskGraph(workspace, name) @@ -21,45 +21,44 @@ All URIs are relative to */v1* Delete the given registered task graph. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.RegisteredTaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the registered task graph. - try { - apiInstance.deleteRegisteredTaskGraph(workspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling RegisteredTaskGraphsApi#deleteRegisteredTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the registered task graph. + try { + apiInstance.deleteRegisteredTaskGraph(workspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling RegisteredTaskGraphsApi#deleteRegisteredTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -76,7 +75,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -90,7 +89,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getRegisteredTaskGraph** > RegisteredTaskGraph getRegisteredTaskGraph(workspace, name) @@ -99,46 +98,45 @@ null (empty response body) Fetch the contents of this registered task graph. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.RegisteredTaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the registered task graph. - try { - RegisteredTaskGraph result = apiInstance.getRegisteredTaskGraph(workspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling RegisteredTaskGraphsApi#getRegisteredTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the registered task graph. + try { + RegisteredTaskGraph result = apiInstance.getRegisteredTaskGraph(workspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RegisteredTaskGraphsApi#getRegisteredTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -155,7 +153,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -169,7 +167,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getRegisteredTaskGraphSharingPolicies** > List<TaskGraphSharing> getRegisteredTaskGraphSharingPolicies(workspace, name) @@ -178,46 +176,45 @@ public class Example { Get sharing policies for the task graph. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.RegisteredTaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | The workspace that owns the registered task graph. - String name = "name_example"; // String | The name of the task graph. - try { - List result = apiInstance.getRegisteredTaskGraphSharingPolicies(workspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling RegisteredTaskGraphsApi#getRegisteredTaskGraphSharingPolicies"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | The workspace that owns the registered task graph. + String name = "name_example"; // String | The name of the task graph. + try { + List result = apiInstance.getRegisteredTaskGraphSharingPolicies(workspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RegisteredTaskGraphsApi#getRegisteredTaskGraphSharingPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -234,7 +231,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -249,7 +246,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **registerRegisteredTaskGraph** > registerRegisteredTaskGraph(workspace, name, graph) @@ -258,46 +255,45 @@ public class Example { Register a task graph in the given namespace, with the given name. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.RegisteredTaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the registered task graph. - RegisteredTaskGraph graph = new RegisteredTaskGraph(); // RegisteredTaskGraph | Task graph to register. - try { - apiInstance.registerRegisteredTaskGraph(workspace, name, graph); - } catch (ApiException e) { - System.err.println("Exception when calling RegisteredTaskGraphsApi#registerRegisteredTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the registered task graph. + RegisteredTaskGraph graph = new RegisteredTaskGraph(); // RegisteredTaskGraph | Task graph to register. + try { + apiInstance.registerRegisteredTaskGraph(workspace, name, graph); + } catch (ApiException e) { + System.err.println("Exception when calling RegisteredTaskGraphsApi#registerRegisteredTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -315,7 +311,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -329,7 +325,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shareRegisteredTaskGraph** > shareRegisteredTaskGraph(workspace, name, taskGraphSharing) @@ -338,46 +334,45 @@ null (empty response body) Share a task graph. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.RegisteredTaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | The workspace that owns the registered task graph. - String name = "name_example"; // String | The name of the task graph. - TaskGraphSharing taskGraphSharing = new TaskGraphSharing(); // TaskGraphSharing | Namespace and list of permissions to share with. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the UDF will not be shared with the namespace at all. - try { - apiInstance.shareRegisteredTaskGraph(workspace, name, taskGraphSharing); - } catch (ApiException e) { - System.err.println("Exception when calling RegisteredTaskGraphsApi#shareRegisteredTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | The workspace that owns the registered task graph. + String name = "name_example"; // String | The name of the task graph. + TaskGraphSharing taskGraphSharing = new TaskGraphSharing(); // TaskGraphSharing | Namespace and list of permissions to share with. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the UDF will not be shared with the namespace at all. + try { + apiInstance.shareRegisteredTaskGraph(workspace, name, taskGraphSharing); + } catch (ApiException e) { + System.err.println("Exception when calling RegisteredTaskGraphsApi#shareRegisteredTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -395,7 +390,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -410,7 +405,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateRegisteredTaskGraph** > updateRegisteredTaskGraph(workspace, name, graph) @@ -419,46 +414,45 @@ null (empty response body) Update the contents of an existing registered task graph. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.RegisteredTaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | The name of the registered task graph. - RegisteredTaskGraph graph = new RegisteredTaskGraph(); // RegisteredTaskGraph | The new contents of the task graph. - try { - apiInstance.updateRegisteredTaskGraph(workspace, name, graph); - } catch (ApiException e) { - System.err.println("Exception when calling RegisteredTaskGraphsApi#updateRegisteredTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + RegisteredTaskGraphsApi apiInstance = new RegisteredTaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | The name of the registered task graph. + RegisteredTaskGraph graph = new RegisteredTaskGraph(); // RegisteredTaskGraph | The new contents of the task graph. + try { + apiInstance.updateRegisteredTaskGraph(workspace, name, graph); + } catch (ApiException e) { + System.err.println("Exception when calling RegisteredTaskGraphsApi#updateRegisteredTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -476,7 +470,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/RetryPolicy.md b/docs/RetryPolicy.md index c202480..d41a45a 100644 --- a/docs/RetryPolicy.md +++ b/docs/RetryPolicy.md @@ -7,11 +7,11 @@ * `ALWAYS` (value: `"Always"`) -* `ONFAILURE` (value: `"OnFailure"`) +* `ON_FAILURE` (value: `"OnFailure"`) -* `ONERROR` (value: `"OnError"`) +* `ON_ERROR` (value: `"OnError"`) -* `ONTRANSIENTERROR` (value: `"OnTransientError"`) +* `ON_TRANSIENT_ERROR` (value: `"OnTransientError"`) diff --git a/docs/SqlApi.md b/docs/SqlApi.md index 78d814e..c8167dc 100644 --- a/docs/SqlApi.md +++ b/docs/SqlApi.md @@ -7,57 +7,56 @@ All URIs are relative to */v1* | [**runSQL**](SqlApi.md#runSQL) | **POST** /sql/{workspace}/{teamspace} | | - + # **runSQL** -> List<Object> runSQL(workspace, teamspace, sql, acceptEncoding) +> List<Map<String, Object>> runSQL(workspace, teamspace, sql, acceptEncoding) Run a sql query ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.SqlApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - SqlApi apiInstance = new SqlApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - SQLParameters sql = new SQLParameters(); // SQLParameters | sql being submitted - String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use - try { - List result = apiInstance.runSQL(workspace, teamspace, sql, acceptEncoding); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SqlApi#runSQL"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + SqlApi apiInstance = new SqlApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the sql query belongs to + SQLParameters sql = new SQLParameters(); // SQLParameters | sql being submitted + String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use + try { + List> result = apiInstance.runSQL(workspace, teamspace, sql, acceptEncoding); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SqlApi#runSQL"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -66,17 +65,17 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the sql query belongs to | | | **sql** | [**SQLParameters**](SQLParameters.md)| sql being submitted | | | **acceptEncoding** | **String**| Encoding to use | [optional] | ### Return type -**List<Object>** +[**List<Map<String, Object>>**](Map.md) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/StatsApi.md b/docs/StatsApi.md index 8d97f39..829caeb 100644 --- a/docs/StatsApi.md +++ b/docs/StatsApi.md @@ -7,7 +7,7 @@ All URIs are relative to */v1* | [**getTiledbStats**](StatsApi.md#getTiledbStats) | **GET** /.stats | | - + # **getTiledbStats** > GetTiledbStats200Response getTiledbStats() @@ -16,44 +16,43 @@ All URIs are relative to */v1* Fetch libtiledb stat ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.StatsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - StatsApi apiInstance = new StatsApi(defaultClient); - try { - GetTiledbStats200Response result = apiInstance.getTiledbStats(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling StatsApi#getTiledbStats"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + StatsApi apiInstance = new StatsApi(defaultClient); + try { + GetTiledbStats200Response result = apiInstance.getTiledbStats(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StatsApi#getTiledbStats"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -66,7 +65,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/TaskGraphLogsApi.md b/docs/TaskGraphLogsApi.md index 30bab18..9cf7d39 100644 --- a/docs/TaskGraphLogsApi.md +++ b/docs/TaskGraphLogsApi.md @@ -15,7 +15,7 @@ All URIs are relative to */v1* | [**updateTaskGraphLog**](TaskGraphLogsApi.md#updateTaskGraphLog) | **PATCH** /taskgraphs/{workspace}/logs/{id} | | - + # **createTaskGraphLog** > TaskGraphLog createTaskGraphLog(workspace, log) @@ -24,46 +24,45 @@ All URIs are relative to */v1* Create a task graph log. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - TaskGraphLog log = new TaskGraphLog(); // TaskGraphLog | - try { - TaskGraphLog result = apiInstance.createTaskGraphLog(workspace, log); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#createTaskGraphLog"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + TaskGraphLog log = new TaskGraphLog(); // TaskGraphLog | + try { + TaskGraphLog result = apiInstance.createTaskGraphLog(workspace, log); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#createTaskGraphLog"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -80,7 +79,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -94,7 +93,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getTaskGraphLog** > TaskGraphLog getTaskGraphLog(workspace, id) @@ -103,46 +102,45 @@ public class Example { Fetch information about a single task graph execution. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph log entry. - try { - TaskGraphLog result = apiInstance.getTaskGraphLog(workspace, id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#getTaskGraphLog"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph log entry. + try { + TaskGraphLog result = apiInstance.getTaskGraphLog(workspace, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#getTaskGraphLog"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -159,7 +157,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -173,7 +171,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listTaskGraphLogs** > TaskGraphLogsData listTaskGraphLogs(namespace, createdBy, status, search, startTime, endTime, page, perPage) @@ -182,52 +180,51 @@ public class Example { Fetch the task graph logs of a namespace the user has access to. The returned entries will include only summary data, and will not include information about the individual tasks that were executed. (This information is available when requesting an individual task graph log.) Entries in the response are ordered from newest to oldest. Pagination parameters work as in other API methods; see PaginationMetadata. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String namespace = "namespace_example"; // String | Include logs for this namespace. - String createdBy = "createdBy_example"; // String | Include logs from only this user. - String status = "status_example"; // String | Filter to only return these statuses - String search = "search_example"; // String | search string that will look at name. - OffsetDateTime startTime = OffsetDateTime.now(); // OffsetDateTime | Include logs created after this time. - OffsetDateTime endTime = OffsetDateTime.now(); // OffsetDateTime | Include logs created before this time. - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - TaskGraphLogsData result = apiInstance.listTaskGraphLogs(namespace, createdBy, status, search, startTime, endTime, page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#listTaskGraphLogs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String namespace = "namespace_example"; // String | Include logs for this namespace. + String createdBy = "createdBy_example"; // String | Include logs from only this user. + String status = "status_example"; // String | Filter to only return these statuses + String search = "search_example"; // String | search string that will look at name. + OffsetDateTime startTime = OffsetDateTime.now(); // OffsetDateTime | Include logs created after this time. + OffsetDateTime endTime = OffsetDateTime.now(); // OffsetDateTime | Include logs created before this time. + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + TaskGraphLogsData result = apiInstance.listTaskGraphLogs(namespace, createdBy, status, search, startTime, endTime, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#listTaskGraphLogs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -250,7 +247,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -264,53 +261,52 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **reportClientNode** > reportClientNode(workspace, id, report) ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph log entry. - TaskGraphClientNodeStatus report = new TaskGraphClientNodeStatus(); // TaskGraphClientNodeStatus | The node status to report. - try { - apiInstance.reportClientNode(workspace, id, report); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#reportClientNode"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph log entry. + TaskGraphClientNodeStatus report = new TaskGraphClientNodeStatus(); // TaskGraphClientNodeStatus | The node status to report. + try { + apiInstance.reportClientNode(workspace, id, report); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#reportClientNode"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -328,7 +324,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -342,7 +338,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **resubmitTaskGraphExecution** > TaskGraphLog resubmitTaskGraphExecution(workspace, id) @@ -351,46 +347,45 @@ null (empty response body) Resubmits a task graph in the given namespace using the associated execution id. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph execution (TaskGraphLog). - try { - TaskGraphLog result = apiInstance.resubmitTaskGraphExecution(workspace, id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#resubmitTaskGraphExecution"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph execution (TaskGraphLog). + try { + TaskGraphLog result = apiInstance.resubmitTaskGraphExecution(workspace, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#resubmitTaskGraphExecution"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -407,7 +402,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -421,7 +416,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **retryTaskGraphExecution** > TaskGraphLog retryTaskGraphExecution(workspace, id) @@ -430,46 +425,45 @@ public class Example { Retries failed tasks of a task graph in the given namespace using the associated execution id. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph execution (TaskGraphLog). - try { - TaskGraphLog result = apiInstance.retryTaskGraphExecution(workspace, id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#retryTaskGraphExecution"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph execution (TaskGraphLog). + try { + TaskGraphLog result = apiInstance.retryTaskGraphExecution(workspace, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#retryTaskGraphExecution"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -486,7 +480,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -500,7 +494,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **stopTaskGraphExecution** > stopTaskGraphExecution(workspace, id) @@ -509,45 +503,44 @@ public class Example { Stops a task graph execution in the given namespace using the associated associated execution id. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph execution (TaskGraphLog). - try { - apiInstance.stopTaskGraphExecution(workspace, id); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#stopTaskGraphExecution"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph execution (TaskGraphLog). + try { + apiInstance.stopTaskGraphExecution(workspace, id); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#stopTaskGraphExecution"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -564,7 +557,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -578,7 +571,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **submitTaskGraph** > TaskGraphLog submitTaskGraph(workspace, id, rootTaskGraphUuid) @@ -587,47 +580,46 @@ null (empty response body) Submit a single task graph for execution. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph entry. - String rootTaskGraphUuid = "rootTaskGraphUuid_example"; // String | UUID of the root taskgraph that this graph is assosiated with - try { - TaskGraphLog result = apiInstance.submitTaskGraph(workspace, id, rootTaskGraphUuid); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#submitTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph entry. + String rootTaskGraphUuid = "rootTaskGraphUuid_example"; // String | UUID of the root taskgraph that this graph is assosiated with + try { + TaskGraphLog result = apiInstance.submitTaskGraph(workspace, id, rootTaskGraphUuid); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#submitTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -645,7 +637,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -659,7 +651,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateTaskGraphLog** > updateTaskGraphLog(workspace, id, log) @@ -668,46 +660,45 @@ public class Example { Update information about a single task graph execution. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphLogsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph log entry. - TaskGraphLog log = new TaskGraphLog(); // TaskGraphLog | Updates to make to the task graph log. The only manual update that a client should need to make to a task graph log is to update its completion status to `succeeded`, `failed`, or `cancelled`. - try { - apiInstance.updateTaskGraphLog(workspace, id, log); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphLogsApi#updateTaskGraphLog"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphLogsApi apiInstance = new TaskGraphLogsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph log entry. + TaskGraphLog log = new TaskGraphLog(); // TaskGraphLog | Updates to make to the task graph log. The only manual update that a client should need to make to a task graph log is to update its completion status to `succeeded`, `failed`, or `cancelled`. + try { + apiInstance.updateTaskGraphLog(workspace, id, log); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphLogsApi#updateTaskGraphLog"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -725,7 +716,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/TaskGraphsApi.md b/docs/TaskGraphsApi.md index 1fabfce..ff259ab 100644 --- a/docs/TaskGraphsApi.md +++ b/docs/TaskGraphsApi.md @@ -11,7 +11,7 @@ All URIs are relative to */v1* | [**updateTaskGraph**](TaskGraphsApi.md#updateTaskGraph) | **PATCH** /taskgraphs/{workspace}/graphs/{id} | | - + # **createTaskGraph** > TaskGraph createTaskGraph(workspace, graph) @@ -20,46 +20,45 @@ All URIs are relative to */v1* Create a single task graph for execution. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - TaskGraph graph = new TaskGraph(); // TaskGraph | Create the task graph. - try { - TaskGraph result = apiInstance.createTaskGraph(workspace, graph); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphsApi#createTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + TaskGraph graph = new TaskGraph(); // TaskGraph | Create the task graph. + try { + TaskGraph result = apiInstance.createTaskGraph(workspace, graph); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphsApi#createTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -76,7 +75,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -90,7 +89,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getTaskGraph** > TaskGraph getTaskGraph(workspace, id) @@ -99,46 +98,45 @@ public class Example { Fetch information about a single task graph. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph entry. - try { - TaskGraph result = apiInstance.getTaskGraph(workspace, id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphsApi#getTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph entry. + try { + TaskGraph result = apiInstance.getTaskGraph(workspace, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphsApi#getTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -155,7 +153,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -169,7 +167,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **listTaskGraphs** > TaskGraphs listTaskGraphs(workspace) @@ -178,45 +176,44 @@ public class Example { Fetch the task graphs of a namespace the user has access to. The returned entries will include only summary data, and will not include information about the individual tasks that were executed. (This information is available when requesting an individual task graph log.) Entries in the response are ordered from newest to oldest. Pagination parameters work as in other API methods; see PaginationMetadata. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - try { - TaskGraphs result = apiInstance.listTaskGraphs(workspace); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphsApi#listTaskGraphs"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + try { + TaskGraphs result = apiInstance.listTaskGraphs(workspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphsApi#listTaskGraphs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -232,7 +229,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -246,7 +243,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **submitTaskGraph** > TaskGraphLog submitTaskGraph(workspace, id, rootTaskGraphUuid) @@ -255,47 +252,46 @@ public class Example { Submit a single task graph for execution. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph entry. - String rootTaskGraphUuid = "rootTaskGraphUuid_example"; // String | UUID of the root taskgraph that this graph is assosiated with - try { - TaskGraphLog result = apiInstance.submitTaskGraph(workspace, id, rootTaskGraphUuid); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphsApi#submitTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph entry. + String rootTaskGraphUuid = "rootTaskGraphUuid_example"; // String | UUID of the root taskgraph that this graph is assosiated with + try { + TaskGraphLog result = apiInstance.submitTaskGraph(workspace, id, rootTaskGraphUuid); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphsApi#submitTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -313,7 +309,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -327,7 +323,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateTaskGraph** > updateTaskGraph(workspace, id, graph) @@ -336,46 +332,45 @@ public class Example { Update information about a single task graph execution. ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TaskGraphsApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String id = "id_example"; // String | The UUID of the task graph entry. - TaskGraph graph = new TaskGraph(); // TaskGraph | Updates to make to the task graph. - try { - apiInstance.updateTaskGraph(workspace, id, graph); - } catch (ApiException e) { - System.err.println("Exception when calling TaskGraphsApi#updateTaskGraph"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TaskGraphsApi apiInstance = new TaskGraphsApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String id = "id_example"; // String | The UUID of the task graph entry. + TaskGraph graph = new TaskGraph(); // TaskGraph | Updates to make to the task graph. + try { + apiInstance.updateTaskGraph(workspace, id, graph); + } catch (ApiException e) { + System.err.println("Exception when calling TaskGraphsApi#updateTaskGraph"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -393,7 +388,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/TasksApi.md b/docs/TasksApi.md index 75a7ed4..160cb10 100644 --- a/docs/TasksApi.md +++ b/docs/TasksApi.md @@ -10,57 +10,56 @@ All URIs are relative to */v1* | [**tasksGet**](TasksApi.md#tasksGet) | **GET** /tasks | | - + # **runSQL** -> List<Object> runSQL(workspace, teamspace, sql, acceptEncoding) +> List<Map<String, Object>> runSQL(workspace, teamspace, sql, acceptEncoding) Run a sql query ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TasksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TasksApi apiInstance = new TasksApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - SQLParameters sql = new SQLParameters(); // SQLParameters | sql being submitted - String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use - try { - List result = apiInstance.runSQL(workspace, teamspace, sql, acceptEncoding); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TasksApi#runSQL"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TasksApi apiInstance = new TasksApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the sql query belongs to + SQLParameters sql = new SQLParameters(); // SQLParameters | sql being submitted + String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use + try { + List> result = apiInstance.runSQL(workspace, teamspace, sql, acceptEncoding); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TasksApi#runSQL"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -69,17 +68,17 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the sql query belongs to | | | **sql** | [**SQLParameters**](SQLParameters.md)| sql being submitted | | | **acceptEncoding** | **String**| Encoding to use | [optional] | ### Return type -**List<Object>** +[**List<Map<String, Object>>**](Map.md) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -94,7 +93,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **taskIdGet** > ArrayTask taskIdGet(id) @@ -103,45 +102,44 @@ public class Example { Fetch an array task ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TasksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TasksApi apiInstance = new TasksApi(defaultClient); - String id = "id_example"; // String | task ID to fetch - try { - ArrayTask result = apiInstance.taskIdGet(id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TasksApi#taskIdGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TasksApi apiInstance = new TasksApi(defaultClient); + String id = "id_example"; // String | task ID to fetch + try { + ArrayTask result = apiInstance.taskIdGet(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TasksApi#taskIdGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -157,7 +155,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -171,7 +169,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **taskIdResultGet** > String taskIdResultGet(id, acceptEncoding) @@ -180,46 +178,45 @@ public class Example { Retrieve results of an array task ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TasksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TasksApi apiInstance = new TasksApi(defaultClient); - String id = "id_example"; // String | task ID to retrieve stored results - String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use - try { - String result = apiInstance.taskIdResultGet(id, acceptEncoding); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TasksApi#taskIdResultGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TasksApi apiInstance = new TasksApi(defaultClient); + String id = "id_example"; // String | task ID to retrieve stored results + String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use + try { + String result = apiInstance.taskIdResultGet(id, acceptEncoding); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TasksApi#taskIdResultGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -236,7 +233,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -252,7 +249,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **tasksGet** > ArrayTaskData tasksGet(namespace, createdBy, array, start, end, page, perPage, type, excludeType, fileType, excludeFileType, status, search, orderby) @@ -261,58 +258,57 @@ public class Example { Fetch a list of all array tasks a user has access to ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.TasksApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - TasksApi apiInstance = new TasksApi(defaultClient); - String namespace = "namespace_example"; // String | namespace to filter - String createdBy = "createdBy_example"; // String | username to filter - String array = "array_example"; // String | name/uri of array that is url-encoded to filter - Integer start = 56; // Integer | start time for tasks to filter by - Integer end = 56; // Integer | end time for tasks to filter by - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - String type = "type_example"; // String | task type, \"QUERY\", \"SQL\", \"UDF\", \"GENERIC_UDF\" - List excludeType = Arrays.asList(); // List | task_type to exclude matching array in results, more than one can be included - List fileType = Arrays.asList(); // List | match file_type of task array, more than one can be included - List excludeFileType = Arrays.asList(); // List | exclude file_type of task arrays, more than one can be included - String status = "status_example"; // String | Filter to only return these statuses - String search = "search_example"; // String | search string that will look at name, namespace or description fields - String orderby = "orderby_example"; // String | sort by which field valid values include start_time, name - try { - ArrayTaskData result = apiInstance.tasksGet(namespace, createdBy, array, start, end, page, perPage, type, excludeType, fileType, excludeFileType, status, search, orderby); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TasksApi#tasksGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + TasksApi apiInstance = new TasksApi(defaultClient); + String namespace = "namespace_example"; // String | namespace to filter + String createdBy = "createdBy_example"; // String | username to filter + String array = "array_example"; // String | name/uri of array that is url-encoded to filter + Integer start = 56; // Integer | start time for tasks to filter by + Integer end = 56; // Integer | end time for tasks to filter by + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + String type = "type_example"; // String | task type, \"QUERY\", \"SQL\", \"UDF\", \"GENERIC_UDF\" + List excludeType = Arrays.asList(); // List | task_type to exclude matching array in results, more than one can be included + List fileType = Arrays.asList(); // List | match file_type of task array, more than one can be included + List excludeFileType = Arrays.asList(); // List | exclude file_type of task arrays, more than one can be included + String status = "status_example"; // String | Filter to only return these statuses + String search = "search_example"; // String | search string that will look at name, namespace or description fields + String orderby = "orderby_example"; // String | sort by which field valid values include start_time, name + try { + ArrayTaskData result = apiInstance.tasksGet(namespace, createdBy, array, start, end, page, perPage, type, excludeType, fileType, excludeFileType, status, search, orderby); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TasksApi#tasksGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -341,7 +337,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/UdfApi.md b/docs/UdfApi.md index c6da072..32f3893 100644 --- a/docs/UdfApi.md +++ b/docs/UdfApi.md @@ -17,7 +17,7 @@ All URIs are relative to */v1* | [**updateUDFInfo**](UdfApi.md#updateUDFInfo) | **PATCH** /udf/{workspace}/{name} | | - + # **deleteUDFInfo** > deleteUDFInfo(workspace, name) @@ -26,45 +26,44 @@ All URIs are relative to */v1* delete a registered UDF -- this will remove all sharing and can not be undone ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name to register UDF under - try { - apiInstance.deleteUDFInfo(workspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#deleteUDFInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name to register UDF under + try { + apiInstance.deleteUDFInfo(workspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#deleteUDFInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -81,7 +80,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -95,7 +94,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getUDFInfo** > UDFInfo getUDFInfo(workspace, name) @@ -104,46 +103,45 @@ null (empty response body) get a specific UDF in the given namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name to register UDF under - try { - UDFInfo result = apiInstance.getUDFInfo(workspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#getUDFInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name to register UDF under + try { + UDFInfo result = apiInstance.getUDFInfo(workspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#getUDFInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -160,7 +158,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -175,7 +173,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getUDFInfoSharingPolicies** > List<UDFSharing> getUDFInfoSharingPolicies(workspace, name) @@ -184,46 +182,45 @@ public class Example { Get all sharing details of the UDF ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name of UDFInfo - try { - List result = apiInstance.getUDFInfoSharingPolicies(workspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#getUDFInfoSharingPolicies"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name of UDFInfo + try { + List result = apiInstance.getUDFInfoSharingPolicies(workspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#getUDFInfoSharingPolicies"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -240,7 +237,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -255,7 +252,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **handleCopyUDF** > UDFCopied handleCopyUDF(workspace, name, udFCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp) @@ -264,49 +261,48 @@ public class Example { Copy a tiledb udf at the specified location ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name of UDFInfo - UDFCopy udFCopy = new UDFCopy(); // UDFCopy | Input/Output information to copy a UDF - String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation - Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch - try { - UDFCopied result = apiInstance.handleCopyUDF(workspace, name, udFCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#handleCopyUDF"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name of UDFInfo + UDFCopy udFCopy = new UDFCopy(); // UDFCopy | Input/Output information to copy a UDF + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = "X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME_example"; // String | Optional registered access credentials to use for creation + Integer endTimestamp = 56; // Integer | Milliseconds since Unix epoch + try { + UDFCopied result = apiInstance.handleCopyUDF(workspace, name, udFCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#handleCopyUDF"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -326,7 +322,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -340,7 +336,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **registerUDFInfo** > registerUDFInfo(workspace, name, udf) @@ -349,46 +345,45 @@ public class Example { register a UDF in the given namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name to register UDF under - UDFInfoUpdate udf = new UDFInfoUpdate(); // UDFInfoUpdate | UDF to register - try { - apiInstance.registerUDFInfo(workspace, name, udf); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#registerUDFInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name to register UDF under + UDFInfoUpdate udf = new UDFInfoUpdate(); // UDFInfoUpdate | UDF to register + try { + apiInstance.registerUDFInfo(workspace, name, udf); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#registerUDFInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -406,7 +401,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -420,7 +415,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **shareUDFInfo** > shareUDFInfo(workspace, name, udfSharing) @@ -429,46 +424,45 @@ null (empty response body) Share a UDF with a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name of UDFInfo - UDFSharing udfSharing = new UDFSharing(); // UDFSharing | Namespace and list of permissions to share with. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the UDF will not be shared with the namespace at all. - try { - apiInstance.shareUDFInfo(workspace, name, udfSharing); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#shareUDFInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name of UDFInfo + UDFSharing udfSharing = new UDFSharing(); // UDFSharing | Namespace and list of permissions to share with. An empty list of permissions will remove the namespace; if permissions already exist they will be deleted then new ones added. In the event of a failure, the new policies will be rolled back to prevent partial policies, and it's likely the UDF will not be shared with the namespace at all. + try { + apiInstance.shareUDFInfo(workspace, name, udfSharing); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#shareUDFInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -486,7 +480,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -501,7 +495,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **submitGenericUDF** > File submitGenericUDF(workspace, udf, acceptEncoding) @@ -510,47 +504,46 @@ null (empty response body) submit a generic UDF in the given namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - GenericUDF udf = new GenericUDF(); // GenericUDF | UDF to run - String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use - try { - File result = apiInstance.submitGenericUDF(workspace, udf, acceptEncoding); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#submitGenericUDF"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + GenericUDF udf = new GenericUDF(); // GenericUDF | UDF to run + String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use + try { + File result = apiInstance.submitGenericUDF(workspace, udf, acceptEncoding); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#submitGenericUDF"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -568,7 +561,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -582,7 +575,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
| - + # **submitMultiArrayUDF** > File submitMultiArrayUDF(workspace, udf, acceptEncoding) @@ -591,47 +584,46 @@ public class Example { submit a multi-array UDF in the given namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - MultiArrayUDF udf = new MultiArrayUDF(); // MultiArrayUDF | UDF to run - String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use - try { - File result = apiInstance.submitMultiArrayUDF(workspace, udf, acceptEncoding); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#submitMultiArrayUDF"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + MultiArrayUDF udf = new MultiArrayUDF(); // MultiArrayUDF | UDF to run + String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use + try { + File result = apiInstance.submitMultiArrayUDF(workspace, udf, acceptEncoding); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#submitMultiArrayUDF"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -649,7 +641,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -663,7 +655,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
| - + # **submitUDF** > File submitUDF(workspace, teamspace, array, udf, xPayer, acceptEncoding, v2) @@ -672,51 +664,50 @@ public class Example { send a UDF to run against a specified array/URI registered to a group/project ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - MultiArrayUDF udf = new MultiArrayUDF(); // MultiArrayUDF | UDF to run - String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request - String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use - String v2 = "v2_example"; // String | flag to indicate if v2 array UDFs should be used, currently in beta testing. Setting any value will enable v2 array UDFs. - try { - File result = apiInstance.submitUDF(workspace, teamspace, array, udf, xPayer, acceptEncoding, v2); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#submitUDF"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + MultiArrayUDF udf = new MultiArrayUDF(); // MultiArrayUDF | UDF to run + String xPayer = "xPayer_example"; // String | Name of organization or user who should be charged for this request + String acceptEncoding = "acceptEncoding_example"; // String | Encoding to use + String v2 = "v2_example"; // String | flag to indicate if v2 array UDFs should be used, currently in beta testing. Setting any value will enable v2 array UDFs. + try { + File result = apiInstance.submitUDF(workspace, teamspace, array, udf, xPayer, acceptEncoding, v2); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#submitUDF"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -738,7 +729,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -752,7 +743,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
| - + # **udfWorkspaceArrayEndTimestampsGet** > ArrayEndTimestampData udfWorkspaceArrayEndTimestampsGet(workspace, array, page, perPage) @@ -761,48 +752,47 @@ public class Example { retrieve a list of timestamps from the array fragment info listing in milliseconds, paginated ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String array = "array_example"; // String | name/uri of array that is url-encoded - Integer page = 56; // Integer | pagination offset - Integer perPage = 56; // Integer | pagination limit - try { - ArrayEndTimestampData result = apiInstance.udfWorkspaceArrayEndTimestampsGet(workspace, array, page, perPage); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#udfWorkspaceArrayEndTimestampsGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String array = "array_example"; // String | name/uri of array that is url-encoded + Integer page = 56; // Integer | pagination offset + Integer perPage = 56; // Integer | pagination limit + try { + ArrayEndTimestampData result = apiInstance.udfWorkspaceArrayEndTimestampsGet(workspace, array, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#udfWorkspaceArrayEndTimestampsGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -821,7 +811,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -835,7 +825,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateUDFInfo** > updateUDFInfo(workspace, name, udf) @@ -844,46 +834,45 @@ public class Example { update an existing registered UDF in the given namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UdfApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UdfApi apiInstance = new UdfApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String name = "name_example"; // String | name to register UDF under - UDFInfoUpdate udf = new UDFInfoUpdate(); // UDFInfoUpdate | UDF to update - try { - apiInstance.updateUDFInfo(workspace, name, udf); - } catch (ApiException e) { - System.err.println("Exception when calling UdfApi#updateUDFInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UdfApi apiInstance = new UdfApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String name = "name_example"; // String | name to register UDF under + UDFInfoUpdate udf = new UDFInfoUpdate(); // UDFInfoUpdate | UDF to update + try { + apiInstance.updateUDFInfo(workspace, name, udf); + } catch (ApiException e) { + System.err.println("Exception when calling UdfApi#updateUDFInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -901,7 +890,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/docs/UserApi.md b/docs/UserApi.md index 7586113..898b5c7 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -28,7 +28,7 @@ All URIs are relative to */v1* | [**updateUserInOrganization**](UserApi.md#updateUserInOrganization) | **PATCH** /organizations/{organization}/{username} | | - + # **addAWSAccessCredentials** > addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials) @@ -37,46 +37,45 @@ All URIs are relative to */v1* Add aws keys ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws access credentials to store for a namespace - try { - apiInstance.addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#addAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws access credentials to store for a namespace + try { + apiInstance.addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#addAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -85,7 +84,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **awsAccessCredentials** | [**AWSAccessCredentials**](AWSAccessCredentials.md)| aws access credentials to store for a namespace | | ### Return type @@ -94,7 +93,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -108,7 +107,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **addUserToOrganization** > addUserToOrganization(organization, user) @@ -117,45 +116,44 @@ null (empty response body) add a user to an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String organization = "organization_example"; // String | organization name - OrganizationUser user = new OrganizationUser(); // OrganizationUser | user to add - try { - apiInstance.addUserToOrganization(organization, user); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#addUserToOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String organization = "organization_example"; // String | organization name + OrganizationUser user = new OrganizationUser(); // OrganizationUser | user to add + try { + apiInstance.addUserToOrganization(organization, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#addUserToOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -172,7 +170,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -186,7 +184,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **checkAWSAccessCredentials** > List<AWSAccessCredentials> checkAWSAccessCredentials(workspace, teamspace) @@ -195,46 +193,45 @@ null (empty response body) Check if aws keys are set ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - try { - List result = apiInstance.checkAWSAccessCredentials(workspace, teamspace); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#checkAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + try { + List result = apiInstance.checkAWSAccessCredentials(workspace, teamspace); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#checkAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -243,7 +240,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | ### Return type @@ -251,7 +248,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -265,7 +262,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **checkAWSAccessCredentialsByName** > AWSAccessCredentials checkAWSAccessCredentialsByName(workspace, teamspace, name) @@ -274,47 +271,46 @@ public class Example { Check if aws keys are set by name ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | name - try { - AWSAccessCredentials result = apiInstance.checkAWSAccessCredentialsByName(workspace, teamspace, name); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#checkAWSAccessCredentialsByName"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + String name = "name_example"; // String | name + try { + AWSAccessCredentials result = apiInstance.checkAWSAccessCredentialsByName(workspace, teamspace, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#checkAWSAccessCredentialsByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -323,7 +319,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **name** | **String**| name | | ### Return type @@ -332,7 +328,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -346,7 +342,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **confirmEmail** > confirmEmail() @@ -355,43 +351,42 @@ public class Example { confirm user email ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - try { - apiInstance.confirmEmail(); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#confirmEmail"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.confirmEmail(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#confirmEmail"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -404,7 +399,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -418,7 +413,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **createUser** > createUser(user) @@ -427,44 +422,31 @@ null (empty response body) create a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - User user = new User(); // User | user to create - try { - apiInstance.createUser(user); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | user to create + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -480,7 +462,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +No authorization required ### HTTP request headers @@ -494,7 +476,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteAWSAccessCredentials** > deleteAWSAccessCredentials(workspace, teamspace, name) @@ -503,46 +485,45 @@ null (empty response body) delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | name - try { - apiInstance.deleteAWSAccessCredentials(workspace, teamspace, name); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + String name = "name_example"; // String | name + try { + apiInstance.deleteAWSAccessCredentials(workspace, teamspace, name); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -551,7 +532,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **name** | **String**| name | | ### Return type @@ -560,7 +541,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -574,7 +555,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteUser** > deleteUser(username) @@ -583,44 +564,43 @@ null (empty response body) delete a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | username or ID - try { - apiInstance.deleteUser(username); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | username or ID + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -636,7 +616,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -650,7 +630,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **deleteUserFromOrganization** > deleteUserFromOrganization(organization, username) @@ -659,45 +639,44 @@ null (empty response body) delete a user from an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String organization = "organization_example"; // String | organization name - String username = "username_example"; // String | username to manipulate - try { - apiInstance.deleteUserFromOrganization(organization, username); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUserFromOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String organization = "organization_example"; // String | organization name + String username = "username_example"; // String | username to manipulate + try { + apiInstance.deleteUserFromOrganization(organization, username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUserFromOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -714,7 +693,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -728,7 +707,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getOrganizationUser** > OrganizationUser getOrganizationUser(organization, username) @@ -737,46 +716,45 @@ null (empty response body) get a user from an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String organization = "organization_example"; // String | organization name - String username = "username_example"; // String | username to manipulate - try { - OrganizationUser result = apiInstance.getOrganizationUser(organization, username); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getOrganizationUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String organization = "organization_example"; // String | organization name + String username = "username_example"; // String | username to manipulate + try { + OrganizationUser result = apiInstance.getOrganizationUser(organization, username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getOrganizationUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -793,7 +771,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -808,7 +786,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getSession** > Token getSession(rememberMe, expires) @@ -817,46 +795,45 @@ public class Example { Get session token for user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String rememberMe = "rememberMe_example"; // String | flag to create a token with expiration of 30 days, default is false - OffsetDateTime expires = OffsetDateTime.now(); // OffsetDateTime | Expiration date for token, if empty token defaults to 30 minutes - try { - Token result = apiInstance.getSession(rememberMe, expires); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getSession"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String rememberMe = "rememberMe_example"; // String | flag to create a token with expiration of 30 days, default is false + OffsetDateTime expires = OffsetDateTime.now(); // OffsetDateTime | Expiration date for token, if empty token defaults to 30 minutes + try { + Token result = apiInstance.getSession(rememberMe, expires); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getSession"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -873,7 +850,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -887,7 +864,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getTokenScopes** > List<TokenScope> getTokenScopes() @@ -896,44 +873,43 @@ public class Example { retrieves available token scopes for a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - try { - List result = apiInstance.getTokenScopes(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getTokenScopes"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + List result = apiInstance.getTokenScopes(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getTokenScopes"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -946,7 +922,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -960,7 +936,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getUser** > User getUser() @@ -969,44 +945,43 @@ This endpoint does not need any parameter. get a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - try { - User result = apiInstance.getUser(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + User result = apiInstance.getUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1019,7 +994,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1033,7 +1008,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **getUserWithUsername** > User getUserWithUsername(username) @@ -1042,45 +1017,44 @@ This endpoint does not need any parameter. get a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | username or ID - try { - User result = apiInstance.getUserWithUsername(username); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserWithUsername"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | username or ID + try { + User result = apiInstance.getUserWithUsername(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserWithUsername"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1096,7 +1070,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1111,7 +1085,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **requestToken** > Token requestToken(tokenRequest) @@ -1120,45 +1094,44 @@ public class Example { Request an authorization token, optionally taken a TokenRequest object to set parameters on the token ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - TokenRequest tokenRequest = new TokenRequest(); // TokenRequest | token request object - try { - Token result = apiInstance.requestToken(tokenRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#requestToken"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + TokenRequest tokenRequest = new TokenRequest(); // TokenRequest | token request object + try { + Token result = apiInstance.requestToken(tokenRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#requestToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1174,7 +1147,7 @@ public class Example { ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1188,7 +1161,7 @@ public class Example { | **502** | Bad Gateway | - | | **0** | error response | - | - + # **resetUserPassword** > resetUserPassword(user) @@ -1197,44 +1170,43 @@ public class Example { reset user password ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - ResetUserPasswordRequest user = new ResetUserPasswordRequest(); // ResetUserPasswordRequest | password to update for user requesting update - try { - apiInstance.resetUserPassword(user); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#resetUserPassword"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + ResetUserPasswordRequest user = new ResetUserPasswordRequest(); // ResetUserPasswordRequest | password to update for user requesting update + try { + apiInstance.resetUserPassword(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#resetUserPassword"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1250,7 +1222,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1265,7 +1237,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **revokeToken** > revokeToken(token) @@ -1274,44 +1246,43 @@ null (empty response body) revoke an authorization token ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String token = "token_example"; // String | token name or token itself - try { - apiInstance.revokeToken(token); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#revokeToken"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String token = "token_example"; // String | token name or token itself + try { + apiInstance.revokeToken(token); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#revokeToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1327,7 +1298,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1341,7 +1312,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **tokensGet** > List<Token> tokensGet() @@ -1350,44 +1321,43 @@ null (empty response body) Fetch a list of user tokens ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - try { - List result = apiInstance.tokensGet(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#tokensGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + List result = apiInstance.tokensGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#tokensGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1400,7 +1370,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1414,7 +1384,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **tokensSessionGet** > List<Token> tokensSessionGet() @@ -1423,44 +1393,43 @@ This endpoint does not need any parameter. Fetch a list of user session tokens ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - try { - List result = apiInstance.tokensSessionGet(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#tokensSessionGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + List result = apiInstance.tokensSessionGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#tokensSessionGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1473,7 +1442,7 @@ This endpoint does not need any parameter. ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1487,7 +1456,7 @@ This endpoint does not need any parameter. | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateAWSAccessCredentials** > updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials) @@ -1496,47 +1465,46 @@ This endpoint does not need any parameter. Update aws keys or associated buckets. This will update the key associations for each array in the namespace ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to - String teamspace = "teamspace_example"; // String | the teamspace the array belongs to - String name = "name_example"; // String | name - AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws credentials to update - try { - apiInstance.updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateAWSAccessCredentials"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String workspace = "workspace_example"; // String | the workspace containing the teamspace the array belongs to + String teamspace = "teamspace_example"; // String | the teamspace the credentials belongs to + String name = "name_example"; // String | name + AWSAccessCredentials awsAccessCredentials = new AWSAccessCredentials(); // AWSAccessCredentials | aws credentials to update + try { + apiInstance.updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateAWSAccessCredentials"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1545,7 +1513,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **workspace** | **String**| the workspace containing the teamspace the array belongs to | | -| **teamspace** | **String**| the teamspace the array belongs to | | +| **teamspace** | **String**| the teamspace the credentials belongs to | | | **name** | **String**| name | | | **awsAccessCredentials** | [**AWSAccessCredentials**](AWSAccessCredentials.md)| aws credentials to update | | @@ -1555,7 +1523,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1569,7 +1537,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateUser** > updateUser(username, user) @@ -1578,45 +1546,44 @@ null (empty response body) update a user ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String username = "username_example"; // String | username or ID - User user = new User(); // User | user details to update - try { - apiInstance.updateUser(username, user); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | username or ID + User user = new User(); // User | user details to update + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1633,7 +1600,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -1647,7 +1614,7 @@ null (empty response body) | **502** | Bad Gateway | - | | **0** | error response | - | - + # **updateUserInOrganization** > updateUserInOrganization(organization, username, user) @@ -1656,46 +1623,45 @@ null (empty response body) update a user in an organization ### Example - ```java // Import classes: - import io.tiledb.cloud.rest_api.ApiClient; import io.tiledb.cloud.rest_api.ApiException; import io.tiledb.cloud.rest_api.Configuration; -import io.tiledb.cloud.models.*; +import io.tiledb.cloud.rest_api.auth.*; +import io.tiledb.cloud.rest_api.models.*; import io.tiledb.cloud.rest_api.api.UserApi; public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("/v1"); - - // 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"); - - // Configure HTTP basic authorization: BasicAuth - HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); - BasicAuth.setUsername("YOUR USERNAME"); - BasicAuth.setPassword("YOUR PASSWORD"); - - UserApi apiInstance = new UserApi(defaultClient); - String organization = "organization_example"; // String | organization name - String username = "username_example"; // String | username to manipulate - OrganizationUser user = new OrganizationUser(); // OrganizationUser | user details to update - try { - apiInstance.updateUserInOrganization(organization, username, user); - } catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUserInOrganization"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/v1"); + + // 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"); + + UserApi apiInstance = new UserApi(defaultClient); + String organization = "organization_example"; // String | organization name + String username = "username_example"; // String | username to manipulate + OrganizationUser user = new OrganizationUser(); // OrganizationUser | user details to update + try { + apiInstance.updateUserInOrganization(organization, username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUserInOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } + } } ``` @@ -1713,7 +1679,7 @@ null (empty response body) ### Authorization -[ApiKeyAuth](../README.md#ApiKeyAuth), [BasicAuth](../README.md#BasicAuth) +[BasicAuth](../README.md#BasicAuth), [ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..e644113 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a2..9623276 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 005bcde..9d0ce63 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 6a68175..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/openapi-v1.yaml b/openapi-v1.yaml index f5db8cc..d431c99 100644 --- a/openapi-v1.yaml +++ b/openapi-v1.yaml @@ -5612,7 +5612,7 @@ paths: required: true - name: array in: path - description: name/uri of array that is url-encoded + description: asset id or path of array that is url-encoded type: string required: true post: @@ -6772,7 +6772,7 @@ paths: required: true - name: teamspace in: path - description: the teamspace the array belongs to + description: the teamspace the credentials belongs to type: string required: true get: @@ -6826,7 +6826,7 @@ paths: required: true - name: teamspace in: path - description: the teamspace the array belongs to + description: the teamspace the credentials belongs to type: string required: true - name: name @@ -7593,7 +7593,7 @@ paths: required: true - name: teamspace in: path - description: the teamspace the array belongs to + description: the teamspace the sql query belongs to type: string required: true - name: Accept-Encoding diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..f227cf2 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.7.0" + } +} diff --git a/regen.sh b/regen.sh new file mode 100755 index 0000000..90edf6c --- /dev/null +++ b/regen.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -ex + +# Regenerate client code +openapi-generator-cli generate -i openapi-v1.yaml -g java -c config.yaml + +# Add all src files +git add src/{main,test}/java +# Add any other existing Git-tracked files (e.g. `.openapi-generator/FILES`) +git add -u . +# openapi-generator-cli tries to bump our Gradle version +git checkout HEAD -- gradle/wrapper/gradle-wrapper.properties + +# Apply custom code / patches +git cherry-pick -n patch + +# Commit changes +if git diff --quiet HEAD; then + echo "Nothing to commit" +else + git commit -m '`regen.sh`' +fi diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5648d96 --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/java/io/tiledb/cloud/CustomCode.txt b/src/main/java/io/tiledb/cloud/CustomCode.txt index bb670c0..cff7227 100644 --- a/src/main/java/io/tiledb/cloud/CustomCode.txt +++ b/src/main/java/io/tiledb/cloud/CustomCode.txt @@ -18,8 +18,8 @@ SqlApi.java 0 error response - */ -public ApiResponse runSQLWithHttpInfoBytes(String namespace, SQLParameters sql, String acceptEncoding) throws ApiException { - okhttp3.Call localVarCall = runSQLValidateBeforeCall(namespace, sql, acceptEncoding, null); +public ApiResponse runSQLWithHttpInfoBytes(String workspace, String namespace, SQLParameters sql, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = runSQLValidateBeforeCall(workspace, namespace, sql, acceptEncoding, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -40,8 +40,8 @@ public ApiResponse runSQLWithHttpInfoBytes(String namespace, SQLParamete 0 error response - */ -public byte[] runSQLBytes(String namespace, SQLParameters sql, String acceptEncoding) throws ApiException { - ApiResponse localVarResp = runSQLWithHttpInfoBytes(namespace, sql, acceptEncoding); +public byte[] runSQLBytes(String workspace, String namespace, SQLParameters sql, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = runSQLWithHttpInfoBytes(workspace, namespace, sql, acceptEncoding); return localVarResp.getData(); } @@ -49,208 +49,208 @@ public byte[] runSQLBytes(String namespace, SQLParameters sql, String acceptEnco UdfApi.java /** -* -* submit a generic UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return ApiResponse<String> -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public ApiResponse submitGenericUDFWithHttpInfoString(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { - okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** -* -* submit a generic UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return String -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public String submitGenericUDFString(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { - ApiResponse localVarResp = submitGenericUDFWithHttpInfoString(namespace, udf, acceptEncoding); - return localVarResp.getData(); + ApiResponse localVarResp = submitGenericUDFWithHttpInfoString(namespace, udf, acceptEncoding); + return localVarResp.getData(); } /** -* -* submit a generic UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return byte[] -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public byte[] submitGenericUDFBytes(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { - ApiResponse localVarResp = submitGenericUDFWithHttpInfoBytes(namespace, udf, acceptEncoding); - return localVarResp.getData(); + ApiResponse localVarResp = submitGenericUDFWithHttpInfoBytes(namespace, udf, acceptEncoding); + return localVarResp.getData(); } /** -* -* submit a generic UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return ApiResponse<byte[]> -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<byte[]> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public ApiResponse submitGenericUDFWithHttpInfoBytes(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { - okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** -* -* submit a generic UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return Object -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public Object submitGenericUDFObj(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { - ApiResponse localVarResp = submitGenericUDFWithHttpInfoObj(namespace, udf, acceptEncoding); - return localVarResp.getData(); + ApiResponse localVarResp = submitGenericUDFWithHttpInfoObj(namespace, udf, acceptEncoding); + return localVarResp.getData(); } /** -* -* submit a generic UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return ApiResponse<Object> -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public ApiResponse submitGenericUDFWithHttpInfoObj(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { - okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** -* -* submit a multi-array UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return String -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public String submitMultiArrayUDFString(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { - ApiResponse localVarResp = submitMultiArrayUDFWithHttpInfoString(namespace, udf, acceptEncoding); - return localVarResp.getData(); + ApiResponse localVarResp = submitMultiArrayUDFWithHttpInfoString(namespace, udf, acceptEncoding); + return localVarResp.getData(); } /** -* -* submit a multi-array UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return ApiResponse<String> -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public ApiResponse submitMultiArrayUDFWithHttpInfoString(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { - okhttp3.Call localVarCall = submitMultiArrayUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = submitMultiArrayUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** -* -* submit a multi-array UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return byte[] -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public byte[] submitMultiArrayUDFBytes(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { - ApiResponse localVarResp = submitMultiArrayUDFWithHttpInfoBytes(namespace, udf, acceptEncoding); - return localVarResp.getData(); + ApiResponse localVarResp = submitMultiArrayUDFWithHttpInfoBytes(namespace, udf, acceptEncoding); + return localVarResp.getData(); } /** -* -* submit a multi-array UDF in the given namespace -* @param namespace namespace array is in (an organization name or user's username) (required) -* @param udf UDF to run (required) -* @param acceptEncoding Encoding to use (optional) -* @return ApiResponse<byte[]> -* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body -* @http.response.details + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<byte[]> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
-*/ + */ public ApiResponse submitMultiArrayUDFWithHttpInfoBytes(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { - okhttp3.Call localVarCall = submitMultiArrayUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = submitMultiArrayUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** @@ -271,8 +271,8 @@ public ApiResponse submitMultiArrayUDFWithHttpInfoBytes(String namespace 0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
*/ -public String submitUDFString(String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { - ApiResponse localVarResp = submitUDFWithHttpInfoString(namespace, array, udf, xPayer, acceptEncoding, v2); +public String submitUDFString(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + ApiResponse localVarResp = submitUDFWithHttpInfoString(workspace, namespace, array, udf, xPayer, acceptEncoding, v2); return localVarResp.getData(); } @@ -294,8 +294,8 @@ public String submitUDFString(String namespace, String array, MultiArrayUDF udf, 0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
*/ -public ApiResponse submitUDFWithHttpInfoString(String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { - okhttp3.Call localVarCall = submitUDFValidateBeforeCall(namespace, array, udf, xPayer, acceptEncoding, v2, null); +public ApiResponse submitUDFWithHttpInfoString(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + okhttp3.Call localVarCall = submitUDFValidateBeforeCall(workspace, namespace, array, udf, xPayer, acceptEncoding, v2, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -318,8 +318,8 @@ public ApiResponse submitUDFWithHttpInfoString(String namespace, String 0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
*/ -public byte[] submitUDFBytes(String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { - ApiResponse localVarResp = submitUDFWithHttpInfoBytes(namespace, array, udf, xPayer, acceptEncoding, v2); +public byte[] submitUDFBytes(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + ApiResponse localVarResp = submitUDFWithHttpInfoBytes(workspace, namespace, array, udf, xPayer, acceptEncoding, v2); return localVarResp.getData(); } @@ -341,8 +341,8 @@ public byte[] submitUDFBytes(String namespace, String array, MultiArrayUDF udf, 0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
*/ -public ApiResponse submitUDFWithHttpInfoBytes(String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { - okhttp3.Call localVarCall = submitUDFValidateBeforeCall(namespace, array, udf, xPayer, acceptEncoding, v2, null); +public ApiResponse submitUDFWithHttpInfoBytes(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + okhttp3.Call localVarCall = submitUDFValidateBeforeCall(workspace, namespace, array, udf, xPayer, acceptEncoding, v2, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); -} \ No newline at end of file +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/ApiClient.java b/src/main/java/io/tiledb/cloud/rest_api/ApiClient.java index f11a2bd..59e35be 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/ApiClient.java +++ b/src/main/java/io/tiledb/cloud/rest_api/ApiClient.java @@ -22,6 +22,7 @@ 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; @@ -48,11 +49,13 @@ 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.auth.Authentication; import io.tiledb.cloud.rest_api.auth.HttpBasicAuth; +import io.tiledb.cloud.rest_api.auth.HttpBearerAuth; import io.tiledb.cloud.rest_api.auth.ApiKeyAuth; import io.tiledb.cloud.rest_api.auth.OAuth; import io.tiledb.cloud.rest_api.auth.RetryingOAuth; @@ -64,6 +67,15 @@ public class ApiClient { private String basePath = "/v1"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "/v1", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); private Map defaultCookieMap = new HashMap(); @@ -93,8 +105,8 @@ public ApiClient() { initHttpClient(); // Setup authentications (key: authentication name, value: authentication). - authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); 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); @@ -111,8 +123,8 @@ public ApiClient(OkHttpClient client) { httpClient = client; // Setup authentications (key: authentication name, value: authentication). - authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); 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); @@ -179,8 +191,8 @@ public ApiClient(String basePath, String clientId, String clientSecret, MapsingletonList(retryingOAuth)); // Setup authentications (key: authentication name, value: authentication). - authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); 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); @@ -228,6 +240,34 @@ public String getBasePath() { */ 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; } @@ -352,10 +392,10 @@ public DateFormat getDateFormat() { *

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

* * @param lenientOnJson a boolean - * @return a {@link ApiClient} object + * @return a {@link io.tiledb.cloud.rest_api.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -498,6 +538,31 @@ public void setAccessToken(String accessToken) { 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). * @@ -680,7 +745,7 @@ public String parameterToString(Object param) { 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); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -688,7 +753,7 @@ public String parameterToString(Object param) { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -898,7 +963,7 @@ public String escapeString(String str) { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * @throws io.tiledb.cloud.rest_api.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") @@ -939,7 +1004,7 @@ public T deserialize(Response response, Type returnType) throws ApiException contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -959,7 +1024,7 @@ public T deserialize(Response response, Type returnType) throws ApiException * @param obj The Java object * @param contentType The request Content-Type * @return The serialized request body - * @throws ApiException If fail to serialize the given object + * @throws io.tiledb.cloud.rest_api.ApiException If fail to serialize the given object */ public RequestBody serialize(Object obj, String contentType) throws ApiException { if (obj instanceof byte[]) { @@ -973,11 +1038,13 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + 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"); } @@ -987,7 +1054,7 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException * Download file from the given response. * * @param response An instance of the Response object - * @throws ApiException If fail to read file content from response and write to disk + * @throws io.tiledb.cloud.rest_api.ApiException If fail to read file content from response and write to disk * @return Downloaded file */ public File downloadFileFromResponse(Response response) throws ApiException { @@ -1051,7 +1118,7 @@ public File prepareDownloadFile(Response response) throws IOException { * @param Type * @param call An instance of the Call object * @return ApiResponse<T> - * @throws ApiException If fail to execute the call + * @throws io.tiledb.cloud.rest_api.ApiException If fail to execute the call */ public ApiResponse execute(Call call) throws ApiException { return execute(call, null); @@ -1066,7 +1133,7 @@ public ApiResponse execute(Call call) throws ApiException { * @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 ApiException If fail to execute the call + * @throws io.tiledb.cloud.rest_api.ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -1130,7 +1197,7 @@ public void onResponse(Call call, Response response) throws IOException { * @param response Response * @param returnType Return type * @return Type - * @throws ApiException If the response has an unsuccessful status code or + * @throws io.tiledb.cloud.rest_api.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 { @@ -1177,7 +1244,7 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP call - * @throws ApiException If fail to serialize the request body object + * @throws io.tiledb.cloud.rest_api.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); @@ -1200,7 +1267,7 @@ public Call buildCall(String baseUrl, String path, String method, List que * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP request - * @throws ApiException If fail to serialize the request body object + * @throws io.tiledb.cloud.rest_api.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 { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams @@ -1212,12 +1279,15 @@ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List if (baseUrl != null) { url.append(baseUrl).append(path); } else { - url.append(basePath).append(path); + 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()) { @@ -1352,7 +1433,7 @@ public void processCookieParams(Map cookieParams, Request.Builde * @param payload HTTP request body * @param method HTTP method * @param uri URI - * @throws ApiException If fails to update the parameters + * @throws io.tiledb.cloud.rest_api.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 { @@ -1397,11 +1478,12 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { for (Object item: list) { if (item instanceof File) { addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); } } } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); } } return mpBuilder.build(); @@ -1435,6 +1517,31 @@ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String k 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 + */ + private 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. @@ -1502,7 +1609,7 @@ public boolean verify(String hostname, SSLSession session) { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); @@ -1535,9 +1642,9 @@ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityExcepti /** * Convert the HTTP request body to a string. * - * @param request The HTTP request object + * @param requestBody The HTTP request object * @return The string representation of the HTTP request body - * @throws ApiException If fail to serialize the request body object into a string + * @throws io.tiledb.cloud.rest_api.ApiException If fail to serialize the request body object into a string */ private String requestBodyToString(RequestBody requestBody) throws ApiException { if (requestBody != null) { diff --git a/src/main/java/io/tiledb/cloud/rest_api/ApiException.java b/src/main/java/io/tiledb/cloud/rest_api/ApiException.java index 138440f..764c77e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/ApiException.java +++ b/src/main/java/io/tiledb/cloud/rest_api/ApiException.java @@ -16,16 +16,19 @@ import java.util.Map; import java.util.List; + /** *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.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.

*/ @@ -97,7 +100,7 @@ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } /** diff --git a/src/main/java/io/tiledb/cloud/rest_api/Configuration.java b/src/main/java/io/tiledb/cloud/rest_api/Configuration.java index 5cb4b3f..b237260 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/Configuration.java +++ b/src/main/java/io/tiledb/cloud/rest_api/Configuration.java @@ -13,8 +13,10 @@ package io.tiledb.cloud.rest_api; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Configuration { + public static final String VERSION = "2.17.51"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/src/main/java/io/tiledb/cloud/rest_api/JSON.java b/src/main/java/io/tiledb/cloud/rest_api/JSON.java index 192327a..1dfec31 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/JSON.java +++ b/src/main/java/io/tiledb/cloud/rest_api/JSON.java @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import okio.ByteString; @@ -85,7 +86,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/io/tiledb/cloud/rest_api/Pair.java b/src/main/java/io/tiledb/cloud/rest_api/Pair.java index bdd1963..3960c7e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/Pair.java +++ b/src/main/java/io/tiledb/cloud/rest_api/Pair.java @@ -13,7 +13,7 @@ package io.tiledb.cloud.rest_api; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/io/tiledb/cloud/rest_api/ServerConfiguration.java b/src/main/java/io/tiledb/cloud/rest_api/ServerConfiguration.java index 199f405..d2a6463 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/ServerConfiguration.java +++ b/src/main/java/io/tiledb/cloud/rest_api/ServerConfiguration.java @@ -5,6 +5,7 @@ /** * Representing a Server configuration. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ServerConfiguration { public String URL; public String description; @@ -42,7 +43,7 @@ public String URL(Map variables) { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/src/main/java/io/tiledb/cloud/rest_api/ServerVariable.java b/src/main/java/io/tiledb/cloud/rest_api/ServerVariable.java index 3a082af..a4c0431 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/ServerVariable.java +++ b/src/main/java/io/tiledb/cloud/rest_api/ServerVariable.java @@ -5,6 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/io/tiledb/cloud/rest_api/StringUtil.java b/src/main/java/io/tiledb/cloud/rest_api/StringUtil.java index fc39954..0d82fe9 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/StringUtil.java +++ b/src/main/java/io/tiledb/cloud/rest_api/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/ArrayApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/ArrayApi.java index c324c2c..6de559a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/ArrayApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/ArrayApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -38,7 +40,7 @@ import io.tiledb.cloud.rest_api.model.ArraySharing; import io.tiledb.cloud.rest_api.model.ArrayVacuumRequest; import java.math.BigDecimal; - +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.FragmentInfo; import io.tiledb.cloud.rest_api.model.FragmentInfoRequest; import io.tiledb.cloud.rest_api.model.LastAccessedArray; @@ -131,9 +133,9 @@ public okhttp3.Call arrayActivityLogCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/activity" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -170,38 +172,34 @@ public okhttp3.Call arrayActivityLogCall(String workspace, String teamspace, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arrayActivityLogValidateBeforeCall(String workspace, String teamspace, String array, Integer start, Integer end, String eventTypes, String taskId, Boolean hasTaskId, 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 arrayActivityLog(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling arrayActivityLog(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling arrayActivityLog(Async)"); } - - okhttp3.Call localVarCall = arrayActivityLogCall(workspace, teamspace, array, start, end, eventTypes, taskId, hasTaskId, _callback); - return localVarCall; + return arrayActivityLogCall(workspace, teamspace, array, start, end, eventTypes, taskId, hasTaskId, _callback); } @@ -394,23 +392,19 @@ public okhttp3.Call arraysBrowserOwnedGetCall(Integer page, Integer perPage, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysBrowserOwnedGetValidateBeforeCall(Integer page, Integer perPage, String search, String namespace, String orderby, String permissions, List tag, List excludeTag, List fileType, List excludeFileType, List fileProperty, Boolean withMetadata, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = arraysBrowserOwnedGetCall(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata, _callback); - return localVarCall; + return arraysBrowserOwnedGetCall(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata, _callback); } @@ -570,23 +564,19 @@ public okhttp3.Call arraysBrowserOwnedSidebarGetCall(List fileType, List } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysBrowserOwnedSidebarGetValidateBeforeCall(List fileType, List excludeFileType, List fileProperty, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = arraysBrowserOwnedSidebarGetCall(fileType, excludeFileType, fileProperty, _callback); - return localVarCall; + return arraysBrowserOwnedSidebarGetCall(fileType, excludeFileType, fileProperty, _callback); } @@ -764,23 +754,19 @@ public okhttp3.Call arraysBrowserPublicGetCall(Integer page, Integer perPage, St } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysBrowserPublicGetValidateBeforeCall(Integer page, Integer perPage, String search, String namespace, String orderby, String permissions, List tag, List excludeTag, List fileType, List excludeFileType, List fileProperty, Boolean withMetadata, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = arraysBrowserPublicGetCall(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata, _callback); - return localVarCall; + return arraysBrowserPublicGetCall(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata, _callback); } @@ -940,23 +926,19 @@ public okhttp3.Call arraysBrowserPublicSidebarGetCall(List fileType, Lis } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysBrowserPublicSidebarGetValidateBeforeCall(List fileType, List excludeFileType, List fileProperty, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = arraysBrowserPublicSidebarGetCall(fileType, excludeFileType, fileProperty, _callback); - return localVarCall; + return arraysBrowserPublicSidebarGetCall(fileType, excludeFileType, fileProperty, _callback); } @@ -1139,23 +1121,19 @@ public okhttp3.Call arraysBrowserSharedGetCall(Integer page, Integer perPage, St } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysBrowserSharedGetValidateBeforeCall(Integer page, Integer perPage, String search, String namespace, String orderby, String permissions, List tag, List excludeTag, List fileType, List excludeFileType, List fileProperty, List sharedTo, Boolean withMetadata, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = arraysBrowserSharedGetCall(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, sharedTo, withMetadata, _callback); - return localVarCall; + return arraysBrowserSharedGetCall(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, sharedTo, withMetadata, _callback); } @@ -1323,23 +1301,19 @@ public okhttp3.Call arraysBrowserSharedSidebarGetCall(List fileType, Lis } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysBrowserSharedSidebarGetValidateBeforeCall(List fileType, List excludeFileType, List fileProperty, List sharedTo, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = arraysBrowserSharedSidebarGetCall(fileType, excludeFileType, fileProperty, sharedTo, _callback); - return localVarCall; + return arraysBrowserSharedSidebarGetCall(fileType, excludeFileType, fileProperty, sharedTo, _callback); } @@ -1449,9 +1423,9 @@ public okhttp3.Call arraysWorkspaceTeamspaceArrayEndTimestampsGetCall(String wor // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/end_timestamps" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1476,38 +1450,34 @@ public okhttp3.Call arraysWorkspaceTeamspaceArrayEndTimestampsGetCall(String wor } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call arraysWorkspaceTeamspaceArrayEndTimestampsGetValidateBeforeCall(String workspace, String teamspace, String array, Integer page, 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 arraysWorkspaceTeamspaceArrayEndTimestampsGet(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling arraysWorkspaceTeamspaceArrayEndTimestampsGet(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling arraysWorkspaceTeamspaceArrayEndTimestampsGet(Async)"); } - - okhttp3.Call localVarCall = arraysWorkspaceTeamspaceArrayEndTimestampsGetCall(workspace, teamspace, array, page, perPage, _callback); - return localVarCall; + return arraysWorkspaceTeamspaceArrayEndTimestampsGetCall(workspace, teamspace, array, page, perPage, _callback); } @@ -1619,9 +1589,9 @@ public okhttp3.Call consolidateArrayCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/consolidate" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1645,36 +1615,33 @@ public okhttp3.Call consolidateArrayCall(String workspace, String teamspace, Str localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call consolidateArrayValidateBeforeCall(String workspace, String teamspace, String array, ArrayConsolidationRequest consolidateRequest, 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 consolidateArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling consolidateArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling consolidateArray(Async)"); } - + // verify the required parameter 'consolidateRequest' is set if (consolidateRequest == null) { throw new ApiException("Missing the required parameter 'consolidateRequest' when calling consolidateArray(Async)"); } - - okhttp3.Call localVarCall = consolidateArrayCall(workspace, teamspace, array, consolidateRequest, _callback); - return localVarCall; + return consolidateArrayCall(workspace, teamspace, array, consolidateRequest, _callback); } @@ -1781,9 +1748,9 @@ public okhttp3.Call createArrayCall(String workspace, String teamspace, String a // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1815,41 +1782,38 @@ public okhttp3.Call createArrayCall(String workspace, String teamspace, String a localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createArrayValidateBeforeCall(String workspace, String teamspace, String array, String contentType, ArraySchema arraySchema, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, 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 createArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling createArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling createArray(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling createArray(Async)"); } - + // verify the required parameter 'arraySchema' is set if (arraySchema == null) { throw new ApiException("Missing the required parameter 'arraySchema' when calling createArray(Async)"); } - - okhttp3.Call localVarCall = createArrayCall(workspace, teamspace, array, contentType, arraySchema, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); - return localVarCall; + return createArrayCall(workspace, teamspace, array, contentType, arraySchema, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); } @@ -1960,9 +1924,9 @@ public okhttp3.Call deleteArrayCall(String workspace, String teamspace, String a // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1983,43 +1947,39 @@ public okhttp3.Call deleteArrayCall(String workspace, String teamspace, String a } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteArrayValidateBeforeCall(String workspace, String teamspace, String array, String contentType, 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 deleteArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling deleteArray(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling deleteArray(Async)"); } - - okhttp3.Call localVarCall = deleteArrayCall(workspace, teamspace, array, contentType, _callback); - return localVarCall; + return deleteArrayCall(workspace, teamspace, array, contentType, _callback); } @@ -2123,9 +2083,9 @@ public okhttp3.Call deregisterArrayCall(String workspace, String teamspace, Stri // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/deregister" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2142,38 +2102,34 @@ public okhttp3.Call deregisterArrayCall(String workspace, String teamspace, Stri } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deregisterArrayValidateBeforeCall(String workspace, String teamspace, String array, 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 deregisterArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deregisterArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling deregisterArray(Async)"); } - - okhttp3.Call localVarCall = deregisterArrayCall(workspace, teamspace, array, _callback); - return localVarCall; + return deregisterArrayCall(workspace, teamspace, array, _callback); } @@ -2275,9 +2231,9 @@ public okhttp3.Call fragmentInfoCall(String workspace, String teamspace, String // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/fragment_info" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2305,41 +2261,38 @@ public okhttp3.Call fragmentInfoCall(String workspace, String teamspace, String localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call fragmentInfoValidateBeforeCall(String workspace, String teamspace, String array, String contentType, FragmentInfoRequest fragmentInfoRequest, 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 fragmentInfo(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling fragmentInfo(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling fragmentInfo(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling fragmentInfo(Async)"); } - + // verify the required parameter 'fragmentInfoRequest' is set if (fragmentInfoRequest == null) { throw new ApiException("Missing the required parameter 'fragmentInfoRequest' when calling fragmentInfo(Async)"); } - - okhttp3.Call localVarCall = fragmentInfoCall(workspace, teamspace, array, contentType, fragmentInfoRequest, _callback); - return localVarCall; + return fragmentInfoCall(workspace, teamspace, array, contentType, fragmentInfoRequest, _callback); } @@ -2448,10 +2401,10 @@ public okhttp3.Call getActivityLogByIdCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/activity/{id}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2468,43 +2421,39 @@ public okhttp3.Call getActivityLogByIdCall(String workspace, String teamspace, S } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getActivityLogByIdValidateBeforeCall(String workspace, String teamspace, String array, String id, 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 getActivityLogById(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getActivityLogById(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getActivityLogById(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getActivityLogById(Async)"); } - - okhttp3.Call localVarCall = getActivityLogByIdCall(workspace, teamspace, array, id, _callback); - return localVarCall; + return getActivityLogByIdCall(workspace, teamspace, array, id, _callback); } @@ -2630,23 +2579,19 @@ public okhttp3.Call getAllArrayMetadataCall(String publicShare, final ApiCallbac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getAllArrayMetadataValidateBeforeCall(String publicShare, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getAllArrayMetadataCall(publicShare, _callback); - return localVarCall; + return getAllArrayMetadataCall(publicShare, _callback); } @@ -2746,9 +2691,9 @@ public okhttp3.Call getArrayCall(String workspace, String teamspace, String arra // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2761,7 +2706,8 @@ public okhttp3.Call getArrayCall(String workspace, String teamspace, String arra } final String[] localVarAccepts = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -2769,43 +2715,39 @@ public okhttp3.Call getArrayCall(String workspace, String teamspace, String arra } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayValidateBeforeCall(String workspace, String teamspace, String array, String contentType, 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 getArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArray(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling getArray(Async)"); } - - okhttp3.Call localVarCall = getArrayCall(workspace, teamspace, array, contentType, _callback); - return localVarCall; + return getArrayCall(workspace, teamspace, array, contentType, _callback); } @@ -2916,9 +2858,9 @@ public okhttp3.Call getArrayMaxBufferSizesCall(String workspace, String teamspac // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/max_buffer_sizes" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2947,48 +2889,44 @@ public okhttp3.Call getArrayMaxBufferSizesCall(String workspace, String teamspac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayMaxBufferSizesValidateBeforeCall(String workspace, String teamspace, String array, String subarray, String contentType, String xPayer, 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 getArrayMaxBufferSizes(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayMaxBufferSizes(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArrayMaxBufferSizes(Async)"); } - + // verify the required parameter 'subarray' is set if (subarray == null) { throw new ApiException("Missing the required parameter 'subarray' when calling getArrayMaxBufferSizes(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling getArrayMaxBufferSizes(Async)"); } - - okhttp3.Call localVarCall = getArrayMaxBufferSizesCall(workspace, teamspace, array, subarray, contentType, xPayer, _callback); - return localVarCall; + return getArrayMaxBufferSizesCall(workspace, teamspace, array, subarray, contentType, xPayer, _callback); } @@ -3104,9 +3042,9 @@ public okhttp3.Call getArrayMetaDataJsonCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/metadata_json" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3131,38 +3069,34 @@ public okhttp3.Call getArrayMetaDataJsonCall(String workspace, String teamspace, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayMetaDataJsonValidateBeforeCall(String workspace, String teamspace, String array, Integer length, 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 getArrayMetaDataJson(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayMetaDataJson(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArrayMetaDataJson(Async)"); } - - okhttp3.Call localVarCall = getArrayMetaDataJsonCall(workspace, teamspace, array, length, endTimestamp, _callback); - return localVarCall; + return getArrayMetaDataJsonCall(workspace, teamspace, array, length, endTimestamp, _callback); } @@ -3174,7 +3108,7 @@ private okhttp3.Call getArrayMetaDataJsonValidateBeforeCall(String workspace, St * @param array name/uri of array that is url-encoded (required) * @param length (optional) limit character length of returned values (optional) * @param endTimestamp Milliseconds since Unix epoch, metadata will use open_at functionality to open array at the specific timestamp (optional) - * @return Object + * @return Map<String, Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3184,8 +3118,8 @@ private okhttp3.Call getArrayMetaDataJsonValidateBeforeCall(String workspace, St
0 error response -
*/ - public Object getArrayMetaDataJson(String workspace, String teamspace, String array, Integer length, Integer endTimestamp) throws ApiException { - ApiResponse localVarResp = getArrayMetaDataJsonWithHttpInfo(workspace, teamspace, array, length, endTimestamp); + public Map getArrayMetaDataJson(String workspace, String teamspace, String array, Integer length, Integer endTimestamp) throws ApiException { + ApiResponse> localVarResp = getArrayMetaDataJsonWithHttpInfo(workspace, teamspace, array, length, endTimestamp); return localVarResp.getData(); } @@ -3197,7 +3131,7 @@ public Object getArrayMetaDataJson(String workspace, String teamspace, String ar * @param array name/uri of array that is url-encoded (required) * @param length (optional) limit character length of returned values (optional) * @param endTimestamp Milliseconds since Unix epoch, metadata will use open_at functionality to open array at the specific timestamp (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Map<String, Object>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3207,9 +3141,9 @@ public Object getArrayMetaDataJson(String workspace, String teamspace, String ar
0 error response -
*/ - public ApiResponse getArrayMetaDataJsonWithHttpInfo(String workspace, String teamspace, String array, Integer length, Integer endTimestamp) throws ApiException { + public ApiResponse> getArrayMetaDataJsonWithHttpInfo(String workspace, String teamspace, String array, Integer length, Integer endTimestamp) throws ApiException { okhttp3.Call localVarCall = getArrayMetaDataJsonValidateBeforeCall(workspace, teamspace, array, length, endTimestamp, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -3232,10 +3166,10 @@ public ApiResponse getArrayMetaDataJsonWithHttpInfo(String workspace, St 0 error response - */ - public okhttp3.Call getArrayMetaDataJsonAsync(String workspace, String teamspace, String array, Integer length, Integer endTimestamp, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getArrayMetaDataJsonAsync(String workspace, String teamspace, String array, Integer length, Integer endTimestamp, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getArrayMetaDataJsonValidateBeforeCall(workspace, teamspace, array, length, endTimestamp, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -3273,9 +3207,9 @@ public okhttp3.Call getArrayMetadataCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/metadata" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3292,38 +3226,34 @@ public okhttp3.Call getArrayMetadataCall(String workspace, String teamspace, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayMetadataValidateBeforeCall(String workspace, String teamspace, String array, 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 getArrayMetadata(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayMetadata(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArrayMetadata(Async)"); } - - okhttp3.Call localVarCall = getArrayMetadataCall(workspace, teamspace, array, _callback); - return localVarCall; + return getArrayMetadataCall(workspace, teamspace, array, _callback); } @@ -3428,9 +3358,9 @@ public okhttp3.Call getArrayMetadataCapnpCall(String workspace, String teamspace // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/array_metadata" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3439,7 +3369,8 @@ public okhttp3.Call getArrayMetadataCapnpCall(String workspace, String teamspace Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -3447,38 +3378,34 @@ public okhttp3.Call getArrayMetadataCapnpCall(String workspace, String teamspace } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayMetadataCapnpValidateBeforeCall(String workspace, String teamspace, String array, 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 getArrayMetadataCapnp(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayMetadataCapnp(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArrayMetadataCapnp(Async)"); } - - okhttp3.Call localVarCall = getArrayMetadataCapnpCall(workspace, teamspace, array, _callback); - return localVarCall; + return getArrayMetadataCapnpCall(workspace, teamspace, array, _callback); } @@ -3585,9 +3512,9 @@ public okhttp3.Call getArrayNonEmptyDomainCall(String workspace, String teamspac // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/non_empty_domain" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3612,43 +3539,39 @@ public okhttp3.Call getArrayNonEmptyDomainCall(String workspace, String teamspac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayNonEmptyDomainValidateBeforeCall(String workspace, String teamspace, String array, String contentType, String xPayer, 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 getArrayNonEmptyDomain(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayNonEmptyDomain(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArrayNonEmptyDomain(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling getArrayNonEmptyDomain(Async)"); } - - okhttp3.Call localVarCall = getArrayNonEmptyDomainCall(workspace, teamspace, array, contentType, xPayer, _callback); - return localVarCall; + return getArrayNonEmptyDomainCall(workspace, teamspace, array, contentType, xPayer, _callback); } @@ -3759,9 +3682,9 @@ public okhttp3.Call getArrayNonEmptyDomainJsonCall(String workspace, String team // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/non_empty_domain_json" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3778,38 +3701,34 @@ public okhttp3.Call getArrayNonEmptyDomainJsonCall(String workspace, String team } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayNonEmptyDomainJsonValidateBeforeCall(String workspace, String teamspace, String array, 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 getArrayNonEmptyDomainJson(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayNonEmptyDomainJson(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArrayNonEmptyDomainJson(Async)"); } - - okhttp3.Call localVarCall = getArrayNonEmptyDomainJsonCall(workspace, teamspace, array, _callback); - return localVarCall; + return getArrayNonEmptyDomainJsonCall(workspace, teamspace, array, _callback); } @@ -3819,7 +3738,7 @@ private okhttp3.Call getArrayNonEmptyDomainJsonValidateBeforeCall(String workspa * @param workspace the workspace containing the teamspace the array belongs to (required) * @param teamspace the teamspace the array belongs to (required) * @param array name/uri of array that is url-encoded (required) - * @return Object + * @return Map<String, Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3829,8 +3748,8 @@ private okhttp3.Call getArrayNonEmptyDomainJsonValidateBeforeCall(String workspa
0 error response -
*/ - public Object getArrayNonEmptyDomainJson(String workspace, String teamspace, String array) throws ApiException { - ApiResponse localVarResp = getArrayNonEmptyDomainJsonWithHttpInfo(workspace, teamspace, array); + public Map getArrayNonEmptyDomainJson(String workspace, String teamspace, String array) throws ApiException { + ApiResponse> localVarResp = getArrayNonEmptyDomainJsonWithHttpInfo(workspace, teamspace, array); return localVarResp.getData(); } @@ -3840,7 +3759,7 @@ public Object getArrayNonEmptyDomainJson(String workspace, String teamspace, Str * @param workspace the workspace containing the teamspace the array belongs to (required) * @param teamspace the teamspace the array belongs to (required) * @param array name/uri of array that is url-encoded (required) - * @return ApiResponse<Object> + * @return ApiResponse<Map<String, Object>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3850,9 +3769,9 @@ public Object getArrayNonEmptyDomainJson(String workspace, String teamspace, Str
0 error response -
*/ - public ApiResponse getArrayNonEmptyDomainJsonWithHttpInfo(String workspace, String teamspace, String array) throws ApiException { + public ApiResponse> getArrayNonEmptyDomainJsonWithHttpInfo(String workspace, String teamspace, String array) throws ApiException { okhttp3.Call localVarCall = getArrayNonEmptyDomainJsonValidateBeforeCall(workspace, teamspace, array, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -3873,10 +3792,10 @@ public ApiResponse getArrayNonEmptyDomainJsonWithHttpInfo(String workspa 0 error response - */ - public okhttp3.Call getArrayNonEmptyDomainJsonAsync(String workspace, String teamspace, String array, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getArrayNonEmptyDomainJsonAsync(String workspace, String teamspace, String array, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getArrayNonEmptyDomainJsonValidateBeforeCall(workspace, teamspace, array, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -3915,9 +3834,9 @@ public okhttp3.Call getArraySampleDataCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/sample" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3938,38 +3857,34 @@ public okhttp3.Call getArraySampleDataCall(String workspace, String teamspace, S } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArraySampleDataValidateBeforeCall(String workspace, String teamspace, String array, BigDecimal samples, 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 getArraySampleData(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArraySampleData(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArraySampleData(Async)"); } - - okhttp3.Call localVarCall = getArraySampleDataCall(workspace, teamspace, array, samples, _callback); - return localVarCall; + return getArraySampleDataCall(workspace, teamspace, array, samples, _callback); } @@ -4078,9 +3993,9 @@ public okhttp3.Call getArraySharingPoliciesCall(String workspace, String teamspa // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4097,38 +4012,34 @@ public okhttp3.Call getArraySharingPoliciesCall(String workspace, String teamspa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArraySharingPoliciesValidateBeforeCall(String workspace, String teamspace, String array, 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 getArraySharingPolicies(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArraySharingPolicies(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getArraySharingPolicies(Async)"); } - - okhttp3.Call localVarCall = getArraySharingPoliciesCall(workspace, teamspace, array, _callback); - return localVarCall; + return getArraySharingPoliciesCall(workspace, teamspace, array, _callback); } @@ -4236,8 +4147,8 @@ public okhttp3.Call getArraysInNamespaceCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4258,33 +4169,29 @@ public okhttp3.Call getArraysInNamespaceCall(String workspace, String teamspace, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArraysInNamespaceValidateBeforeCall(String workspace, String teamspace, Boolean withMetadata, 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 getArraysInNamespace(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArraysInNamespace(Async)"); } - - okhttp3.Call localVarCall = getArraysInNamespaceCall(workspace, teamspace, withMetadata, _callback); - return localVarCall; + return getArraysInNamespaceCall(workspace, teamspace, withMetadata, _callback); } @@ -4390,9 +4297,9 @@ public okhttp3.Call getFragmentEndTimestampCall(String workspace, String teamspa // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/fragment_end_timestamp" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4413,38 +4320,34 @@ public okhttp3.Call getFragmentEndTimestampCall(String workspace, String teamspa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getFragmentEndTimestampValidateBeforeCall(String workspace, String teamspace, String array, 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 getFragmentEndTimestamp(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getFragmentEndTimestamp(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getFragmentEndTimestamp(Async)"); } - - okhttp3.Call localVarCall = getFragmentEndTimestampCall(workspace, teamspace, array, endTimestamp, _callback); - return localVarCall; + return getFragmentEndTimestampCall(workspace, teamspace, array, endTimestamp, _callback); } @@ -4565,23 +4468,19 @@ public okhttp3.Call getLastAccessedArraysCall(final ApiCallback _callback) throw } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getLastAccessedArraysValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getLastAccessedArraysCall(_callback); - return localVarCall; + return getLastAccessedArraysCall(_callback); } @@ -4679,9 +4578,9 @@ public okhttp3.Call loadArraySchemaCall(String workspace, String teamspace, Stri // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/schema" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4705,36 +4604,33 @@ public okhttp3.Call loadArraySchemaCall(String workspace, String teamspace, Stri localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call loadArraySchemaValidateBeforeCall(String workspace, String teamspace, String array, LoadArraySchemaRequest loadArraySchemaRequest, 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 loadArraySchema(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling loadArraySchema(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling loadArraySchema(Async)"); } - + // verify the required parameter 'loadArraySchemaRequest' is set if (loadArraySchemaRequest == null) { throw new ApiException("Missing the required parameter 'loadArraySchemaRequest' when calling loadArraySchema(Async)"); } - - okhttp3.Call localVarCall = loadArraySchemaCall(workspace, teamspace, array, loadArraySchemaRequest, _callback); - return localVarCall; + return loadArraySchemaCall(workspace, teamspace, array, loadArraySchemaRequest, _callback); } @@ -4847,9 +4743,9 @@ public okhttp3.Call loadEnumerationsCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/enumerations" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4873,36 +4769,33 @@ public okhttp3.Call loadEnumerationsCall(String workspace, String teamspace, Str localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call loadEnumerationsValidateBeforeCall(String workspace, String teamspace, String array, LoadEnumerationsRequest loadEnumerationsRequest, 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 loadEnumerations(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling loadEnumerations(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling loadEnumerations(Async)"); } - + // verify the required parameter 'loadEnumerationsRequest' is set if (loadEnumerationsRequest == null) { throw new ApiException("Missing the required parameter 'loadEnumerationsRequest' when calling loadEnumerations(Async)"); } - - okhttp3.Call localVarCall = loadEnumerationsCall(workspace, teamspace, array, loadEnumerationsRequest, _callback); - return localVarCall; + return loadEnumerationsCall(workspace, teamspace, array, loadEnumerationsRequest, _callback); } @@ -4983,7 +4876,7 @@ public okhttp3.Call loadEnumerationsAsync(String workspace, String teamspace, St * Build call for registerArray * @param workspace the workspace containing the teamspace the array belongs to (required) * @param teamspace the teamspace the array belongs to (required) - * @param array name/uri of array that is url-encoded (required) + * @param array asset id or path of array that is url-encoded (required) * @param arrayMetadata metadata associated with array (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -5014,9 +4907,9 @@ public okhttp3.Call registerArrayCall(String workspace, String teamspace, String // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/register" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5040,36 +4933,33 @@ public okhttp3.Call registerArrayCall(String workspace, String teamspace, String localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call registerArrayValidateBeforeCall(String workspace, String teamspace, String array, ArrayInfoUpdate arrayMetadata, 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 registerArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling registerArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling registerArray(Async)"); } - + // verify the required parameter 'arrayMetadata' is set if (arrayMetadata == null) { throw new ApiException("Missing the required parameter 'arrayMetadata' when calling registerArray(Async)"); } - - okhttp3.Call localVarCall = registerArrayCall(workspace, teamspace, array, arrayMetadata, _callback); - return localVarCall; + return registerArrayCall(workspace, teamspace, array, arrayMetadata, _callback); } @@ -5078,7 +4968,7 @@ private okhttp3.Call registerArrayValidateBeforeCall(String workspace, String te * register an array at a specified URI registered to the given namespace * @param workspace the workspace containing the teamspace the array belongs to (required) * @param teamspace the teamspace the array belongs to (required) - * @param array name/uri of array that is url-encoded (required) + * @param array asset id or path of array that is url-encoded (required) * @param arrayMetadata metadata associated with array (required) * @return ArrayInfo * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -5100,7 +4990,7 @@ public ArrayInfo registerArray(String workspace, String teamspace, String array, * register an array at a specified URI registered to the given namespace * @param workspace the workspace containing the teamspace the array belongs to (required) * @param teamspace the teamspace the array belongs to (required) - * @param array name/uri of array that is url-encoded (required) + * @param array asset id or path of array that is url-encoded (required) * @param arrayMetadata metadata associated with array (required) * @return ApiResponse<ArrayInfo> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -5123,7 +5013,7 @@ public ApiResponse registerArrayWithHttpInfo(String workspace, String * register an array at a specified URI registered to the given namespace * @param workspace the workspace containing the teamspace the array belongs to (required) * @param teamspace the teamspace the array belongs to (required) - * @param array name/uri of array that is url-encoded (required) + * @param array asset id or path of array that is url-encoded (required) * @param arrayMetadata metadata associated with array (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -5179,9 +5069,9 @@ public okhttp3.Call shareArrayCall(String workspace, String teamspace, String ar // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5205,36 +5095,33 @@ public okhttp3.Call shareArrayCall(String workspace, String teamspace, String ar localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shareArrayValidateBeforeCall(String workspace, String teamspace, String array, ArraySharing arraySharing, 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 shareArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling shareArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling shareArray(Async)"); } - + // verify the required parameter 'arraySharing' is set if (arraySharing == null) { throw new ApiException("Missing the required parameter 'arraySharing' when calling shareArray(Async)"); } - - okhttp3.Call localVarCall = shareArrayCall(workspace, teamspace, array, arraySharing, _callback); - return localVarCall; + return shareArrayCall(workspace, teamspace, array, arraySharing, _callback); } @@ -5342,9 +5229,9 @@ public okhttp3.Call updateArrayMetadataCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/metadata" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5368,36 +5255,33 @@ public okhttp3.Call updateArrayMetadataCall(String workspace, String teamspace, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateArrayMetadataValidateBeforeCall(String workspace, String teamspace, String array, ArrayInfoUpdate arrayMetadata, 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 updateArrayMetadata(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling updateArrayMetadata(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling updateArrayMetadata(Async)"); } - + // verify the required parameter 'arrayMetadata' is set if (arrayMetadata == null) { throw new ApiException("Missing the required parameter 'arrayMetadata' when calling updateArrayMetadata(Async)"); } - - okhttp3.Call localVarCall = updateArrayMetadataCall(workspace, teamspace, array, arrayMetadata, _callback); - return localVarCall; + return updateArrayMetadataCall(workspace, teamspace, array, arrayMetadata, _callback); } @@ -5502,9 +5386,9 @@ public okhttp3.Call updateArrayMetadataCapnpCall(String workspace, String teamsp // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/array_metadata" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5513,7 +5397,8 @@ public okhttp3.Call updateArrayMetadataCapnpCall(String workspace, String teamsp Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -5521,43 +5406,41 @@ public okhttp3.Call updateArrayMetadataCapnpCall(String workspace, String teamsp } final String[] localVarContentTypes = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateArrayMetadataCapnpValidateBeforeCall(String workspace, String teamspace, String array, ArrayMetadata arrayMetadataEntries, 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 updateArrayMetadataCapnp(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling updateArrayMetadataCapnp(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling updateArrayMetadataCapnp(Async)"); } - + // verify the required parameter 'arrayMetadataEntries' is set if (arrayMetadataEntries == null) { throw new ApiException("Missing the required parameter 'arrayMetadataEntries' when calling updateArrayMetadataCapnp(Async)"); } - - okhttp3.Call localVarCall = updateArrayMetadataCapnpCall(workspace, teamspace, array, arrayMetadataEntries, _callback); - return localVarCall; + return updateArrayMetadataCapnpCall(workspace, teamspace, array, arrayMetadataEntries, _callback); } @@ -5662,9 +5545,9 @@ public okhttp3.Call vacuumArrayCall(String workspace, String teamspace, String a // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/vacuum" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5688,36 +5571,33 @@ public okhttp3.Call vacuumArrayCall(String workspace, String teamspace, String a localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call vacuumArrayValidateBeforeCall(String workspace, String teamspace, String array, ArrayVacuumRequest vaccumRequest, 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 vacuumArray(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling vacuumArray(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling vacuumArray(Async)"); } - + // verify the required parameter 'vaccumRequest' is set if (vaccumRequest == null) { throw new ApiException("Missing the required parameter 'vaccumRequest' when calling vacuumArray(Async)"); } - - okhttp3.Call localVarCall = vacuumArrayCall(workspace, teamspace, array, vaccumRequest, _callback); - return localVarCall; + return vacuumArrayCall(workspace, teamspace, array, vaccumRequest, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/ArrayTasksApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/ArrayTasksApi.java index f5a36ab..624eebb 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/ArrayTasksApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/ArrayTasksApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -26,6 +28,7 @@ import io.tiledb.cloud.rest_api.model.ArrayTaskBrowserSidebar; +import io.tiledb.cloud.rest_api.model.Error; import java.lang.reflect.Type; import java.util.ArrayList; @@ -128,23 +131,19 @@ public okhttp3.Call getArrayTasksSidebarCall(Integer start, Integer end, final A } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayTasksSidebarValidateBeforeCall(Integer start, Integer end, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getArrayTasksSidebarCall(start, end, _callback); - return localVarCall; + return getArrayTasksSidebarCall(start, end, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/AssetsApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/AssetsApi.java index d330f82..c1f2f2d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/AssetsApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/AssetsApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -27,6 +29,7 @@ import io.tiledb.cloud.rest_api.model.AssetListResponse; import io.tiledb.cloud.rest_api.model.ChangeAssetCredentialsRequest; +import io.tiledb.cloud.rest_api.model.Error; import java.lang.reflect.Type; import java.util.ArrayList; @@ -105,8 +108,8 @@ public okhttp3.Call changeAssetCredentialsCall(String workspace, String teamspac // create path and map variables String localVarPath = "/assets/{workspace}/{teamspace}/change_credentials" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -130,31 +133,28 @@ public okhttp3.Call changeAssetCredentialsCall(String workspace, String teamspac localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call changeAssetCredentialsValidateBeforeCall(String workspace, String teamspace, ChangeAssetCredentialsRequest changeCredentialsRequest, 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 changeAssetCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling changeAssetCredentials(Async)"); } - + // verify the required parameter 'changeCredentialsRequest' is set if (changeCredentialsRequest == null) { throw new ApiException("Missing the required parameter 'changeCredentialsRequest' when calling changeAssetCredentials(Async)"); } - - okhttp3.Call localVarCall = changeAssetCredentialsCall(workspace, teamspace, changeCredentialsRequest, _callback); - return localVarCall; + return changeAssetCredentialsCall(workspace, teamspace, changeCredentialsRequest, _callback); } @@ -262,8 +262,8 @@ public okhttp3.Call listAssetsCall(String workspace, String teamspace, String as // create path and map variables String localVarPath = "/assets/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -312,33 +312,29 @@ public okhttp3.Call listAssetsCall(String workspace, String teamspace, String as } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listAssetsValidateBeforeCall(String workspace, String teamspace, String assetType, String ownershipLevel, String depth, String search, Integer page, Integer perPage, String orderBy, String expand, 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)"); } - - okhttp3.Call localVarCall = listAssetsCall(workspace, teamspace, assetType, ownershipLevel, depth, search, page, perPage, orderBy, expand, _callback); - return localVarCall; + return listAssetsCall(workspace, teamspace, assetType, ownershipLevel, depth, search, page, perPage, orderBy, expand, _callback); } @@ -507,23 +503,19 @@ public okhttp3.Call listPublicAssetsCall(String assetType, String depth, String } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listPublicAssetsValidateBeforeCall(String assetType, String depth, String search, Integer page, Integer perPage, String orderBy, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listPublicAssetsCall(assetType, depth, search, page, perPage, orderBy, _callback); - return localVarCall; + return listPublicAssetsCall(assetType, depth, search, page, perPage, orderBy, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/FavoritesApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/FavoritesApi.java index ed298a0..00de0eb 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/FavoritesApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/FavoritesApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -27,6 +29,7 @@ import io.tiledb.cloud.rest_api.model.ArrayFavorite; import io.tiledb.cloud.rest_api.model.ArrayFavoritesData; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.MLModelFavorite; import io.tiledb.cloud.rest_api.model.MLModelFavoritesData; import io.tiledb.cloud.rest_api.model.NotebookFavorite; @@ -111,9 +114,9 @@ public okhttp3.Call addArrayFavoriteCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/arrays/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -130,38 +133,34 @@ public okhttp3.Call addArrayFavoriteCall(String workspace, String teamspace, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addArrayFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 addArrayFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling addArrayFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling addArrayFavorite(Async)"); } - - okhttp3.Call localVarCall = addArrayFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return addArrayFavoriteCall(workspace, teamspace, name, _callback); } @@ -262,9 +261,9 @@ public okhttp3.Call addMLModelFavoriteCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/ml_models/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -281,38 +280,34 @@ public okhttp3.Call addMLModelFavoriteCall(String workspace, String teamspace, S } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addMLModelFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 addMLModelFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling addMLModelFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling addMLModelFavorite(Async)"); } - - okhttp3.Call localVarCall = addMLModelFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return addMLModelFavoriteCall(workspace, teamspace, name, _callback); } @@ -413,9 +408,9 @@ public okhttp3.Call addNotebookFavoriteCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/notebooks/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -432,38 +427,34 @@ public okhttp3.Call addNotebookFavoriteCall(String workspace, String teamspace, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addNotebookFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 addNotebookFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling addNotebookFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling addNotebookFavorite(Async)"); } - - okhttp3.Call localVarCall = addNotebookFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return addNotebookFavoriteCall(workspace, teamspace, name, _callback); } @@ -563,8 +554,8 @@ public okhttp3.Call addUDFFavoriteCall(String workspace, String name, final ApiC // create path and map variables String localVarPath = "/udfs/favorites/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -581,33 +572,29 @@ public okhttp3.Call addUDFFavoriteCall(String workspace, String name, final ApiC } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addUDFFavoriteValidateBeforeCall(String workspace, String name, 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 addUDFFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling addUDFFavorite(Async)"); } - - okhttp3.Call localVarCall = addUDFFavoriteCall(workspace, name, _callback); - return localVarCall; + return addUDFFavoriteCall(workspace, name, _callback); } @@ -705,9 +692,9 @@ public okhttp3.Call deleteArrayFavoriteCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/arrays/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -724,38 +711,34 @@ public okhttp3.Call deleteArrayFavoriteCall(String workspace, String teamspace, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteArrayFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 deleteArrayFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteArrayFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteArrayFavorite(Async)"); } - - okhttp3.Call localVarCall = deleteArrayFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return deleteArrayFavoriteCall(workspace, teamspace, name, _callback); } @@ -856,9 +839,9 @@ public okhttp3.Call deleteMLModelFavoriteCall(String workspace, String teamspace // create path and map variables String localVarPath = "/ml_models/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -875,38 +858,34 @@ public okhttp3.Call deleteMLModelFavoriteCall(String workspace, String teamspace } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteMLModelFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 deleteMLModelFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteMLModelFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteMLModelFavorite(Async)"); } - - okhttp3.Call localVarCall = deleteMLModelFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return deleteMLModelFavoriteCall(workspace, teamspace, name, _callback); } @@ -1007,9 +986,9 @@ public okhttp3.Call deleteNotebookFavoriteCall(String workspace, String teamspac // create path and map variables String localVarPath = "/notebooks/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1026,38 +1005,34 @@ public okhttp3.Call deleteNotebookFavoriteCall(String workspace, String teamspac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteNotebookFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 deleteNotebookFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteNotebookFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteNotebookFavorite(Async)"); } - - okhttp3.Call localVarCall = deleteNotebookFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return deleteNotebookFavoriteCall(workspace, teamspace, name, _callback); } @@ -1157,8 +1132,8 @@ public okhttp3.Call deleteUDFFavoriteCall(String workspace, String name, final A // create path and map variables String localVarPath = "/udfs/favorites/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1175,33 +1150,29 @@ public okhttp3.Call deleteUDFFavoriteCall(String workspace, String name, final A } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteUDFFavoriteValidateBeforeCall(String workspace, String name, 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 deleteUDFFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteUDFFavorite(Async)"); } - - okhttp3.Call localVarCall = deleteUDFFavoriteCall(workspace, name, _callback); - return localVarCall; + return deleteUDFFavoriteCall(workspace, name, _callback); } @@ -1299,9 +1270,9 @@ public okhttp3.Call getArrayFavoriteCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/arrays/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1318,38 +1289,34 @@ public okhttp3.Call getArrayFavoriteCall(String workspace, String teamspace, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getArrayFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 getArrayFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getArrayFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getArrayFavorite(Async)"); } - - okhttp3.Call localVarCall = getArrayFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return getArrayFavoriteCall(workspace, teamspace, name, _callback); } @@ -1454,9 +1421,9 @@ public okhttp3.Call getMLModelFavoriteCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/ml_models/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1473,38 +1440,34 @@ public okhttp3.Call getMLModelFavoriteCall(String workspace, String teamspace, S } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getMLModelFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 getMLModelFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getMLModelFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getMLModelFavorite(Async)"); } - - okhttp3.Call localVarCall = getMLModelFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return getMLModelFavoriteCall(workspace, teamspace, name, _callback); } @@ -1609,9 +1572,9 @@ public okhttp3.Call getNotebookFavoriteCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/notebooks/favorites/{workspace}/{teamspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1628,38 +1591,34 @@ public okhttp3.Call getNotebookFavoriteCall(String workspace, String teamspace, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getNotebookFavoriteValidateBeforeCall(String workspace, String teamspace, String name, 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 getNotebookFavorite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getNotebookFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getNotebookFavorite(Async)"); } - - okhttp3.Call localVarCall = getNotebookFavoriteCall(workspace, teamspace, name, _callback); - return localVarCall; + return getNotebookFavoriteCall(workspace, teamspace, name, _callback); } @@ -1763,8 +1722,8 @@ public okhttp3.Call getUDFFavoriteCall(String workspace, String name, final ApiC // create path and map variables String localVarPath = "/udfs/favorites/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1781,33 +1740,29 @@ public okhttp3.Call getUDFFavoriteCall(String workspace, String name, final ApiC } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getUDFFavoriteValidateBeforeCall(String workspace, String name, 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 getUDFFavorite(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getUDFFavorite(Async)"); } - - okhttp3.Call localVarCall = getUDFFavoriteCall(workspace, name, _callback); - return localVarCall; + return getUDFFavoriteCall(workspace, name, _callback); } @@ -1932,23 +1887,19 @@ public okhttp3.Call listArrayFavoritesCall(Integer page, Integer perPage, final } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listArrayFavoritesValidateBeforeCall(Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listArrayFavoritesCall(page, perPage, _callback); - return localVarCall; + return listArrayFavoritesCall(page, perPage, _callback); } @@ -2063,23 +2014,19 @@ public okhttp3.Call listArrayFavoritesUUIDsCall(final ApiCallback _callback) thr } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listArrayFavoritesUUIDsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listArrayFavoritesUUIDsCall(_callback); - return localVarCall; + return listArrayFavoritesUUIDsCall(_callback); } @@ -2198,23 +2145,19 @@ public okhttp3.Call listMLModelFavoritesCall(Integer page, Integer perPage, fina } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listMLModelFavoritesValidateBeforeCall(Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listMLModelFavoritesCall(page, perPage, _callback); - return localVarCall; + return listMLModelFavoritesCall(page, perPage, _callback); } @@ -2329,23 +2272,19 @@ public okhttp3.Call listMLModelFavoritesUUIDsCall(final ApiCallback _callback) t } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listMLModelFavoritesUUIDsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listMLModelFavoritesUUIDsCall(_callback); - return localVarCall; + return listMLModelFavoritesUUIDsCall(_callback); } @@ -2469,23 +2408,19 @@ public okhttp3.Call listNotebookFavoritesCall(Boolean isDashboard, Integer page, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listNotebookFavoritesValidateBeforeCall(Boolean isDashboard, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listNotebookFavoritesCall(isDashboard, page, perPage, _callback); - return localVarCall; + return listNotebookFavoritesCall(isDashboard, page, perPage, _callback); } @@ -2603,23 +2538,19 @@ public okhttp3.Call listNotebookFavoritesUUIDsCall(final ApiCallback _callback) } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listNotebookFavoritesUUIDsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listNotebookFavoritesUUIDsCall(_callback); - return localVarCall; + return listNotebookFavoritesUUIDsCall(_callback); } @@ -2738,23 +2669,19 @@ public okhttp3.Call listUDFFavoritesCall(Integer page, Integer perPage, final Ap } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listUDFFavoritesValidateBeforeCall(Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listUDFFavoritesCall(page, perPage, _callback); - return localVarCall; + return listUDFFavoritesCall(page, perPage, _callback); } @@ -2869,23 +2796,19 @@ public okhttp3.Call listUDFFavoritesUUIDsCall(final ApiCallback _callback) throw } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listUDFFavoritesUUIDsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listUDFFavoritesUUIDsCall(_callback); - return localVarCall; + return listUDFFavoritesUUIDsCall(_callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/FilesApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/FilesApi.java index f2f3ccb..ced13cd 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/FilesApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/FilesApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import java.io.File; import io.tiledb.cloud.rest_api.model.FileCreate; import io.tiledb.cloud.rest_api.model.FileCreated; @@ -110,8 +113,8 @@ public okhttp3.Call handleCreateFileCall(String workspace, String teamspace, Fil // create path and map variables String localVarPath = "/files/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -139,31 +142,28 @@ public okhttp3.Call handleCreateFileCall(String workspace, String teamspace, Fil localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call handleCreateFileValidateBeforeCall(String workspace, String teamspace, FileCreate fileCreate, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, 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 handleCreateFile(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling handleCreateFile(Async)"); } - + // verify the required parameter 'fileCreate' is set if (fileCreate == null) { throw new ApiException("Missing the required parameter 'fileCreate' when calling handleCreateFile(Async)"); } - - okhttp3.Call localVarCall = handleCreateFileCall(workspace, teamspace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); - return localVarCall; + return handleCreateFileCall(workspace, teamspace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); } @@ -272,9 +272,9 @@ public okhttp3.Call handleExportFileCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/files/{workspace}/{teamspace}/{file}/export" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "file" + "\\}", localVarApiClient.escapeString(_file.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "file" + "}", localVarApiClient.escapeString(_file.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -298,36 +298,33 @@ public okhttp3.Call handleExportFileCall(String workspace, String teamspace, Str localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call handleExportFileValidateBeforeCall(String workspace, String teamspace, String _file, FileExport fileExport, 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 handleExportFile(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling handleExportFile(Async)"); } - + // verify the required parameter '_file' is set if (_file == null) { throw new ApiException("Missing the required parameter '_file' when calling handleExportFile(Async)"); } - + // verify the required parameter 'fileExport' is set if (fileExport == null) { throw new ApiException("Missing the required parameter 'fileExport' when calling handleExportFile(Async)"); } - - okhttp3.Call localVarCall = handleExportFileCall(workspace, teamspace, _file, fileExport, _callback); - return localVarCall; + return handleExportFileCall(workspace, teamspace, _file, fileExport, _callback); } @@ -438,8 +435,8 @@ public okhttp3.Call handleUploadFileCall(String workspace, String teamspace, Fil // create path and map variables String localVarPath = "/files/{workspace}/{teamspace}/upload" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -479,31 +476,28 @@ public okhttp3.Call handleUploadFileCall(String workspace, String teamspace, Fil localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call handleUploadFileValidateBeforeCall(String workspace, String teamspace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, String name, 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 handleUploadFile(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling handleUploadFile(Async)"); } - + // verify the required parameter 'inputFile' is set if (inputFile == null) { throw new ApiException("Missing the required parameter 'inputFile' when calling handleUploadFile(Async)"); } - - okhttp3.Call localVarCall = handleUploadFileCall(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, _callback); - return localVarCall; + return handleUploadFileCall(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/GroupsApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/GroupsApi.java index ac42a21..d54b27c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/GroupsApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/GroupsApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.GroupBrowserData; import io.tiledb.cloud.rest_api.model.GroupBrowserFilterData; import io.tiledb.cloud.rest_api.model.GroupChanges; @@ -116,9 +119,9 @@ public okhttp3.Call changeGroupContentsCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}/contents" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -142,31 +145,28 @@ public okhttp3.Call changeGroupContentsCall(String workspace, String teamspace, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call changeGroupContentsValidateBeforeCall(String workspace, String teamspace, String groupName, GroupChanges groupChanges, 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 changeGroupContents(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling changeGroupContents(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling changeGroupContents(Async)"); } - - okhttp3.Call localVarCall = changeGroupContentsCall(workspace, teamspace, groupName, groupChanges, _callback); - return localVarCall; + return changeGroupContentsCall(workspace, teamspace, groupName, groupChanges, _callback); } @@ -270,8 +270,8 @@ public okhttp3.Call createGroupCall(String workspace, String teamspace, GroupCre // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/create" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -295,26 +295,23 @@ public okhttp3.Call createGroupCall(String workspace, String teamspace, GroupCre localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createGroupValidateBeforeCall(String workspace, String teamspace, GroupCreate groupCreate, 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 createGroup(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling createGroup(Async)"); } - - okhttp3.Call localVarCall = createGroupCall(workspace, teamspace, groupCreate, _callback); - return localVarCall; + return createGroupCall(workspace, teamspace, groupCreate, _callback); } @@ -415,9 +412,9 @@ public okhttp3.Call deleteGroupCall(String workspace, String teamspace, String g // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -434,38 +431,34 @@ public okhttp3.Call deleteGroupCall(String workspace, String teamspace, String g } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteGroupValidateBeforeCall(String workspace, String teamspace, String groupName, 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 deleteGroup(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteGroup(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling deleteGroup(Async)"); } - - okhttp3.Call localVarCall = deleteGroupCall(workspace, teamspace, groupName, _callback); - return localVarCall; + return deleteGroupCall(workspace, teamspace, groupName, _callback); } @@ -566,9 +559,9 @@ public okhttp3.Call getGroupCall(String workspace, String teamspace, String grou // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -585,38 +578,34 @@ public okhttp3.Call getGroupCall(String workspace, String teamspace, String grou } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getGroupValidateBeforeCall(String workspace, String teamspace, String groupName, 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 getGroup(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getGroup(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling getGroup(Async)"); } - - okhttp3.Call localVarCall = getGroupCall(workspace, teamspace, groupName, _callback); - return localVarCall; + return getGroupCall(workspace, teamspace, groupName, _callback); } @@ -723,9 +712,9 @@ public okhttp3.Call getGroupActivityCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}/content_activity" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -750,38 +739,34 @@ public okhttp3.Call getGroupActivityCall(String workspace, String teamspace, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getGroupActivityValidateBeforeCall(String workspace, String teamspace, String groupName, Integer page, 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 getGroupActivity(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getGroupActivity(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling getGroupActivity(Async)"); } - - okhttp3.Call localVarCall = getGroupActivityCall(workspace, teamspace, groupName, page, perPage, _callback); - return localVarCall; + return getGroupActivityCall(workspace, teamspace, groupName, page, perPage, _callback); } @@ -901,9 +886,9 @@ public okhttp3.Call getGroupContentsCall(String workspace, String teamspace, Str // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}/contents" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -956,38 +941,34 @@ public okhttp3.Call getGroupContentsCall(String workspace, String teamspace, Str } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getGroupContentsValidateBeforeCall(String workspace, String teamspace, String groupName, Integer page, Integer perPage, String namespace, String search, String orderby, List tag, List excludeTag, List memberType, List excludeMemberType, 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 getGroupContents(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getGroupContents(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling getGroupContents(Async)"); } - - okhttp3.Call localVarCall = getGroupContentsCall(workspace, teamspace, groupName, page, perPage, namespace, search, orderby, tag, excludeTag, memberType, excludeMemberType, _callback); - return localVarCall; + return getGroupContentsCall(workspace, teamspace, groupName, page, perPage, namespace, search, orderby, tag, excludeTag, memberType, excludeMemberType, _callback); } @@ -1120,9 +1101,9 @@ public okhttp3.Call getGroupSharingPoliciesCall(String workspace, String teamspa // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1139,38 +1120,34 @@ public okhttp3.Call getGroupSharingPoliciesCall(String workspace, String teamspa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getGroupSharingPoliciesValidateBeforeCall(String workspace, String teamspace, String groupName, 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 getGroupSharingPolicies(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getGroupSharingPolicies(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling getGroupSharingPolicies(Async)"); } - - okhttp3.Call localVarCall = getGroupSharingPoliciesCall(workspace, teamspace, groupName, _callback); - return localVarCall; + return getGroupSharingPoliciesCall(workspace, teamspace, groupName, _callback); } @@ -1296,23 +1273,19 @@ public okhttp3.Call groupsBrowserOwnedFiltersGetCall(String namespace, final Api } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call groupsBrowserOwnedFiltersGetValidateBeforeCall(String namespace, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = groupsBrowserOwnedFiltersGetCall(namespace, _callback); - return localVarCall; + return groupsBrowserOwnedFiltersGetCall(namespace, _callback); } @@ -1424,23 +1397,19 @@ public okhttp3.Call groupsBrowserPublicFiltersGetCall(final ApiCallback _callbac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call groupsBrowserPublicFiltersGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = groupsBrowserPublicFiltersGetCall(_callback); - return localVarCall; + return groupsBrowserPublicFiltersGetCall(_callback); } @@ -1554,23 +1523,19 @@ public okhttp3.Call groupsBrowserSharedFiltersGetCall(String namespace, final Ap } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call groupsBrowserSharedFiltersGetValidateBeforeCall(String namespace, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = groupsBrowserSharedFiltersGetCall(namespace, _callback); - return localVarCall; + return groupsBrowserSharedFiltersGetCall(namespace, _callback); } @@ -1669,9 +1634,9 @@ public okhttp3.Call groupsWorkspaceTeamspaceGroupNameContentsFiltersGetCall(Stri // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}/contents/filters" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1688,38 +1653,34 @@ public okhttp3.Call groupsWorkspaceTeamspaceGroupNameContentsFiltersGetCall(Stri } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call groupsWorkspaceTeamspaceGroupNameContentsFiltersGetValidateBeforeCall(String workspace, String teamspace, String groupName, 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 groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(Async)"); } - - okhttp3.Call localVarCall = groupsWorkspaceTeamspaceGroupNameContentsFiltersGetCall(workspace, teamspace, groupName, _callback); - return localVarCall; + return groupsWorkspaceTeamspaceGroupNameContentsFiltersGetCall(workspace, teamspace, groupName, _callback); } @@ -1897,23 +1858,19 @@ public okhttp3.Call listOwnedGroupsCall(Integer page, Integer perPage, String gr } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listOwnedGroupsValidateBeforeCall(Integer page, Integer perPage, String groupType, String search, String namespace, String orderby, String permissions, List tag, List excludeTag, Boolean flat, String parent, Boolean withMetadata, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listOwnedGroupsCall(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata, _callback); - return localVarCall; + return listOwnedGroupsCall(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata, _callback); } @@ -2118,23 +2075,19 @@ public okhttp3.Call listPublicGroupsCall(Integer page, Integer perPage, String g } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listPublicGroupsValidateBeforeCall(Integer page, Integer perPage, String groupType, String search, String namespace, String orderby, String permissions, List tag, List excludeTag, Boolean flat, String parent, Boolean withMetadata, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listPublicGroupsCall(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata, _callback); - return localVarCall; + return listPublicGroupsCall(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata, _callback); } @@ -2344,23 +2297,19 @@ public okhttp3.Call listSharedGroupsCall(Integer page, Integer perPage, String g } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listSharedGroupsValidateBeforeCall(Integer page, Integer perPage, String groupType, String search, String namespace, String orderby, String permissions, List tag, List excludeTag, Boolean flat, String parent, List sharedTo, Boolean withMetadata, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listSharedGroupsCall(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, sharedTo, withMetadata, _callback); - return localVarCall; + return listSharedGroupsCall(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, sharedTo, withMetadata, _callback); } @@ -2496,9 +2445,9 @@ public okhttp3.Call registerGroupCall(String workspace, String teamspace, String // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{array}/register" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2522,31 +2471,28 @@ public okhttp3.Call registerGroupCall(String workspace, String teamspace, String localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call registerGroupValidateBeforeCall(String workspace, String teamspace, String array, GroupRegister groupRegister, 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 registerGroup(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling registerGroup(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling registerGroup(Async)"); } - - okhttp3.Call localVarCall = registerGroupCall(workspace, teamspace, array, groupRegister, _callback); - return localVarCall; + return registerGroupCall(workspace, teamspace, array, groupRegister, _callback); } @@ -2652,9 +2598,9 @@ public okhttp3.Call shareGroupCall(String workspace, String teamspace, String gr // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2678,36 +2624,33 @@ public okhttp3.Call shareGroupCall(String workspace, String teamspace, String gr localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shareGroupValidateBeforeCall(String workspace, String teamspace, String groupName, GroupSharingRequest groupSharingRequest, 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 shareGroup(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling shareGroup(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling shareGroup(Async)"); } - + // verify the required parameter 'groupSharingRequest' is set if (groupSharingRequest == null) { throw new ApiException("Missing the required parameter 'groupSharingRequest' when calling shareGroup(Async)"); } - - okhttp3.Call localVarCall = shareGroupCall(workspace, teamspace, groupName, groupSharingRequest, _callback); - return localVarCall; + return shareGroupCall(workspace, teamspace, groupName, groupSharingRequest, _callback); } @@ -2815,9 +2758,9 @@ public okhttp3.Call updateGroupCall(String workspace, String teamspace, String g // create path and map variables String localVarPath = "/groups/{workspace}/{teamspace}/{group_name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2841,31 +2784,28 @@ public okhttp3.Call updateGroupCall(String workspace, String teamspace, String g localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateGroupValidateBeforeCall(String workspace, String teamspace, String groupName, GroupUpdate groupUpdate, 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 updateGroup(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling updateGroup(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling updateGroup(Async)"); } - - okhttp3.Call localVarCall = updateGroupCall(workspace, teamspace, groupName, groupUpdate, _callback); - return localVarCall; + return updateGroupCall(workspace, teamspace, groupName, groupUpdate, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/InvitationApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/InvitationApi.java index 6702350..006fcb1 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/InvitationApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/InvitationApi.java @@ -19,14 +19,18 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.InvitationArrayShareEmail; import io.tiledb.cloud.rest_api.model.InvitationData; +import io.tiledb.cloud.rest_api.model.InvitationFailedRecipients; import io.tiledb.cloud.rest_api.model.InvitationGroupShareEmail; import io.tiledb.cloud.rest_api.model.InvitationOrganizationJoinEmail; import io.tiledb.cloud.rest_api.model.SharePaymentRequest; @@ -107,7 +111,7 @@ public okhttp3.Call acceptInvitationCall(String invitation, final ApiCallback _c // create path and map variables String localVarPath = "/invitations/{invitation}" - .replaceAll("\\{" + "invitation" + "\\}", localVarApiClient.escapeString(invitation.toString())); + .replace("{" + "invitation" + "}", localVarApiClient.escapeString(invitation.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -124,28 +128,24 @@ public okhttp3.Call acceptInvitationCall(String invitation, final ApiCallback _c } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call acceptInvitationValidateBeforeCall(String invitation, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'invitation' is set if (invitation == null) { throw new ApiException("Missing the required parameter 'invitation' when calling acceptInvitation(Async)"); } - - okhttp3.Call localVarCall = acceptInvitationCall(invitation, _callback); - return localVarCall; + return acceptInvitationCall(invitation, _callback); } @@ -243,8 +243,8 @@ public okhttp3.Call cancelJoinOrganizationCall(String invitation, String organiz // create path and map variables String localVarPath = "/invitations/{invitation}/{organization}/join" - .replaceAll("\\{" + "invitation" + "\\}", localVarApiClient.escapeString(invitation.toString())) - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "invitation" + "}", localVarApiClient.escapeString(invitation.toString())) + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -261,33 +261,29 @@ public okhttp3.Call cancelJoinOrganizationCall(String invitation, String organiz } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelJoinOrganizationValidateBeforeCall(String invitation, String organization, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'invitation' is set if (invitation == null) { throw new ApiException("Missing the required parameter 'invitation' when calling cancelJoinOrganization(Async)"); } - + // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling cancelJoinOrganization(Async)"); } - - okhttp3.Call localVarCall = cancelJoinOrganizationCall(invitation, organization, _callback); - return localVarCall; + return cancelJoinOrganizationCall(invitation, organization, _callback); } @@ -390,10 +386,10 @@ public okhttp3.Call cancelShareArrayByInviteCall(String workspace, String teamsp // create path and map variables String localVarPath = "/invitations/{invitation}/{workspace}/{teamspace}/{array}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "invitation" + "\\}", localVarApiClient.escapeString(invitation.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "invitation" + "}", localVarApiClient.escapeString(invitation.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -410,43 +406,39 @@ public okhttp3.Call cancelShareArrayByInviteCall(String workspace, String teamsp } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelShareArrayByInviteValidateBeforeCall(String workspace, String teamspace, String invitation, String array, 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 cancelShareArrayByInvite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling cancelShareArrayByInvite(Async)"); } - + // verify the required parameter 'invitation' is set if (invitation == null) { throw new ApiException("Missing the required parameter 'invitation' when calling cancelShareArrayByInvite(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling cancelShareArrayByInvite(Async)"); } - - okhttp3.Call localVarCall = cancelShareArrayByInviteCall(workspace, teamspace, invitation, array, _callback); - return localVarCall; + return cancelShareArrayByInviteCall(workspace, teamspace, invitation, array, _callback); } @@ -555,10 +547,10 @@ public okhttp3.Call cancelShareGroupByInviteCall(String workspace, String teamsp // create path and map variables String localVarPath = "/invitations/group/{invitation}/{workspace}/{teamspace}/{group_name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "invitation" + "\\}", localVarApiClient.escapeString(invitation.toString())) - .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "invitation" + "}", localVarApiClient.escapeString(invitation.toString())) + .replace("{" + "group_name" + "}", localVarApiClient.escapeString(groupName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -575,43 +567,39 @@ public okhttp3.Call cancelShareGroupByInviteCall(String workspace, String teamsp } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelShareGroupByInviteValidateBeforeCall(String workspace, String teamspace, String invitation, String groupName, 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 cancelShareGroupByInvite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling cancelShareGroupByInvite(Async)"); } - + // verify the required parameter 'invitation' is set if (invitation == null) { throw new ApiException("Missing the required parameter 'invitation' when calling cancelShareGroupByInvite(Async)"); } - + // verify the required parameter 'groupName' is set if (groupName == null) { throw new ApiException("Missing the required parameter 'groupName' when calling cancelShareGroupByInvite(Async)"); } - - okhttp3.Call localVarCall = cancelShareGroupByInviteCall(workspace, teamspace, invitation, groupName, _callback); - return localVarCall; + return cancelShareGroupByInviteCall(workspace, teamspace, invitation, groupName, _callback); } @@ -718,9 +706,9 @@ public okhttp3.Call cancelSharePaymentCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/invitations/share_payment/{workspace}/{teamspace}/{target}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "target" + "\\}", localVarApiClient.escapeString(target.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "target" + "}", localVarApiClient.escapeString(target.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -737,38 +725,34 @@ public okhttp3.Call cancelSharePaymentCall(String workspace, String teamspace, S } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelSharePaymentValidateBeforeCall(String workspace, String teamspace, String target, 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 cancelSharePayment(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling cancelSharePayment(Async)"); } - + // verify the required parameter 'target' is set if (target == null) { throw new ApiException("Missing the required parameter 'target' when calling cancelSharePayment(Async)"); } - - okhttp3.Call localVarCall = cancelSharePaymentCall(workspace, teamspace, target, _callback); - return localVarCall; + return cancelSharePaymentCall(workspace, teamspace, target, _callback); } @@ -932,23 +916,19 @@ public okhttp3.Call fetchInvitationsCall(String organization, String array, Stri } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call fetchInvitationsValidateBeforeCall(String organization, String array, String group, Integer start, Integer end, Integer page, Integer perPage, String type, String status, String orderby, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fetchInvitationsCall(organization, array, group, start, end, page, perPage, type, status, orderby, _callback); - return localVarCall; + return fetchInvitationsCall(organization, array, group, start, end, page, perPage, type, status, orderby, _callback); } @@ -1075,7 +1055,7 @@ public okhttp3.Call joinOrganizationCall(String organization, InvitationOrganiza // create path and map variables String localVarPath = "/invitations/{organization}/join" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1099,26 +1079,23 @@ public okhttp3.Call joinOrganizationCall(String organization, InvitationOrganiza localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call joinOrganizationValidateBeforeCall(String organization, InvitationOrganizationJoinEmail emailInvite, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling joinOrganization(Async)"); } - + // verify the required parameter 'emailInvite' is set if (emailInvite == null) { throw new ApiException("Missing the required parameter 'emailInvite' when calling joinOrganization(Async)"); } - - okhttp3.Call localVarCall = joinOrganizationCall(organization, emailInvite, _callback); - return localVarCall; + return joinOrganizationCall(organization, emailInvite, _callback); } @@ -1225,9 +1202,9 @@ public okhttp3.Call shareArrayByInviteCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/invitations/{workspace}/{teamspace}/{array}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1251,36 +1228,33 @@ public okhttp3.Call shareArrayByInviteCall(String workspace, String teamspace, S localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shareArrayByInviteValidateBeforeCall(String workspace, String teamspace, String array, InvitationArrayShareEmail emailInvite, 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 shareArrayByInvite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling shareArrayByInvite(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling shareArrayByInvite(Async)"); } - + // verify the required parameter 'emailInvite' is set if (emailInvite == null) { throw new ApiException("Missing the required parameter 'emailInvite' when calling shareArrayByInvite(Async)"); } - - okhttp3.Call localVarCall = shareArrayByInviteCall(workspace, teamspace, array, emailInvite, _callback); - return localVarCall; + return shareArrayByInviteCall(workspace, teamspace, array, emailInvite, _callback); } @@ -1393,9 +1367,9 @@ public okhttp3.Call shareGroupByInviteCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/invitations/group/{workspace}/{teamspace}/{group}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "group" + "\\}", localVarApiClient.escapeString(group.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "group" + "}", localVarApiClient.escapeString(group.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1419,36 +1393,33 @@ public okhttp3.Call shareGroupByInviteCall(String workspace, String teamspace, S localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shareGroupByInviteValidateBeforeCall(String workspace, String teamspace, String group, InvitationGroupShareEmail emailInvite, 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 shareGroupByInvite(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling shareGroupByInvite(Async)"); } - + // verify the required parameter 'group' is set if (group == null) { throw new ApiException("Missing the required parameter 'group' when calling shareGroupByInvite(Async)"); } - + // verify the required parameter 'emailInvite' is set if (emailInvite == null) { throw new ApiException("Missing the required parameter 'emailInvite' when calling shareGroupByInvite(Async)"); } - - okhttp3.Call localVarCall = shareGroupByInviteCall(workspace, teamspace, group, emailInvite, _callback); - return localVarCall; + return shareGroupByInviteCall(workspace, teamspace, group, emailInvite, _callback); } @@ -1560,8 +1531,8 @@ public okhttp3.Call sharePaymentCall(String workspace, String teamspace, SharePa // create path and map variables String localVarPath = "/invitations/share_payment/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1585,26 +1556,23 @@ public okhttp3.Call sharePaymentCall(String workspace, String teamspace, SharePa localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call sharePaymentValidateBeforeCall(String workspace, String teamspace, SharePaymentRequest emailInvite, 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 sharePayment(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling sharePayment(Async)"); } - - okhttp3.Call localVarCall = sharePaymentCall(workspace, teamspace, emailInvite, _callback); - return localVarCall; + return sharePaymentCall(workspace, teamspace, emailInvite, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/NotebookApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/NotebookApi.java index 11d9392..3e53e7e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/NotebookApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/NotebookApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -26,7 +28,7 @@ import io.tiledb.cloud.rest_api.model.ArrayInfoUpdate; - +import io.tiledb.cloud.rest_api.model.Error; import java.io.File; import io.tiledb.cloud.rest_api.model.FileUploaded; import io.tiledb.cloud.rest_api.model.NotebookCopied; @@ -111,8 +113,8 @@ public okhttp3.Call getNotebookServerStatusCall(String workspace, String teamspa // create path and map variables String localVarPath = "/notebooks/server/{workspace}/{teamspace}/status" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -129,33 +131,29 @@ public okhttp3.Call getNotebookServerStatusCall(String workspace, String teamspa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getNotebookServerStatusValidateBeforeCall(String workspace, 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 getNotebookServerStatus(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getNotebookServerStatus(Async)"); } - - okhttp3.Call localVarCall = getNotebookServerStatusCall(workspace, teamspace, _callback); - return localVarCall; + return getNotebookServerStatusCall(workspace, teamspace, _callback); } @@ -266,9 +264,9 @@ public okhttp3.Call handleCopyNotebookCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/notebooks/{workspace}/{teamspace}/{array}/copy" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -300,36 +298,33 @@ public okhttp3.Call handleCopyNotebookCall(String workspace, String teamspace, S localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call handleCopyNotebookValidateBeforeCall(String workspace, String teamspace, String array, NotebookCopy notebookCopy, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, 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 handleCopyNotebook(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling handleCopyNotebook(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling handleCopyNotebook(Async)"); } - + // verify the required parameter 'notebookCopy' is set if (notebookCopy == null) { throw new ApiException("Missing the required parameter 'notebookCopy' when calling handleCopyNotebook(Async)"); } - - okhttp3.Call localVarCall = handleCopyNotebookCall(workspace, teamspace, array, notebookCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp, _callback); - return localVarCall; + return handleCopyNotebookCall(workspace, teamspace, array, notebookCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp, _callback); } @@ -446,8 +441,8 @@ public okhttp3.Call handleUploadNotebookCall(String workspace, String teamspace, // create path and map variables String localVarPath = "/notebooks/{workspace}/{teamspace}/upload" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -487,31 +482,28 @@ public okhttp3.Call handleUploadNotebookCall(String workspace, String teamspace, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call handleUploadNotebookValidateBeforeCall(String workspace, String teamspace, File inputFile, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String outputUri, String name, 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 handleUploadNotebook(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling handleUploadNotebook(Async)"); } - + // verify the required parameter 'inputFile' is set if (inputFile == null) { throw new ApiException("Missing the required parameter 'inputFile' when calling handleUploadNotebook(Async)"); } - - okhttp3.Call localVarCall = handleUploadNotebookCall(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, _callback); - return localVarCall; + return handleUploadNotebookCall(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name, _callback); } @@ -625,8 +617,8 @@ public okhttp3.Call shutdownNotebookServerCall(String workspace, String teamspac // create path and map variables String localVarPath = "/notebooks/server/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -643,33 +635,29 @@ public okhttp3.Call shutdownNotebookServerCall(String workspace, String teamspac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shutdownNotebookServerValidateBeforeCall(String workspace, 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 shutdownNotebookServer(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling shutdownNotebookServer(Async)"); } - - okhttp3.Call localVarCall = shutdownNotebookServerCall(workspace, teamspace, _callback); - return localVarCall; + return shutdownNotebookServerCall(workspace, teamspace, _callback); } @@ -771,9 +759,9 @@ public okhttp3.Call updateNotebookNameCall(String workspace, String teamspace, S // create path and map variables String localVarPath = "/notebooks/{workspace}/{teamspace}/{array}/rename" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -797,36 +785,33 @@ public okhttp3.Call updateNotebookNameCall(String workspace, String teamspace, S localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateNotebookNameValidateBeforeCall(String workspace, String teamspace, String array, ArrayInfoUpdate notebookMetadata, 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 updateNotebookName(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling updateNotebookName(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling updateNotebookName(Async)"); } - + // verify the required parameter 'notebookMetadata' is set if (notebookMetadata == null) { throw new ApiException("Missing the required parameter 'notebookMetadata' when calling updateNotebookName(Async)"); } - - okhttp3.Call localVarCall = updateNotebookNameCall(workspace, teamspace, array, notebookMetadata, _callback); - return localVarCall; + return updateNotebookNameCall(workspace, teamspace, array, notebookMetadata, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/NotebooksApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/NotebooksApi.java index e423a42..aa02a36 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/NotebooksApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/NotebooksApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -26,6 +28,7 @@ import io.tiledb.cloud.rest_api.model.ArrayEndTimestampData; +import io.tiledb.cloud.rest_api.model.Error; import java.lang.reflect.Type; import java.util.ArrayList; @@ -106,9 +109,9 @@ public okhttp3.Call notebooksWorkspaceTeamspaceArrayEndTimestampsGetCall(String // create path and map variables String localVarPath = "/notebooks/{workspace}/{teamspace}/{array}/end_timestamps" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -133,38 +136,34 @@ public okhttp3.Call notebooksWorkspaceTeamspaceArrayEndTimestampsGetCall(String } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call notebooksWorkspaceTeamspaceArrayEndTimestampsGetValidateBeforeCall(String workspace, String teamspace, String array, Integer page, 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 notebooksWorkspaceTeamspaceArrayEndTimestampsGet(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling notebooksWorkspaceTeamspaceArrayEndTimestampsGet(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling notebooksWorkspaceTeamspaceArrayEndTimestampsGet(Async)"); } - - okhttp3.Call localVarCall = notebooksWorkspaceTeamspaceArrayEndTimestampsGetCall(workspace, teamspace, array, page, perPage, _callback); - return localVarCall; + return notebooksWorkspaceTeamspaceArrayEndTimestampsGetCall(workspace, teamspace, array, page, perPage, _callback); } @@ -276,9 +275,9 @@ public okhttp3.Call notebooksWorkspaceTeamspaceArrayPrunePostCall(String workspa // create path and map variables String localVarPath = "/notebooks/{workspace}/{teamspace}/{array}/prune" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -299,38 +298,34 @@ public okhttp3.Call notebooksWorkspaceTeamspaceArrayPrunePostCall(String workspa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call notebooksWorkspaceTeamspaceArrayPrunePostValidateBeforeCall(String workspace, String teamspace, String array, Integer keepVersions, 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 notebooksWorkspaceTeamspaceArrayPrunePost(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling notebooksWorkspaceTeamspaceArrayPrunePost(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling notebooksWorkspaceTeamspaceArrayPrunePost(Async)"); } - - okhttp3.Call localVarCall = notebooksWorkspaceTeamspaceArrayPrunePostCall(workspace, teamspace, array, keepVersions, _callback); - return localVarCall; + return notebooksWorkspaceTeamspaceArrayPrunePostCall(workspace, teamspace, array, keepVersions, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/OrganizationApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/OrganizationApi.java index 677c09a..c995930 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/OrganizationApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/OrganizationApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -27,6 +29,7 @@ import io.tiledb.cloud.rest_api.model.AWSAccessCredentials; import io.tiledb.cloud.rest_api.model.DomainCheckResult; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.Organization; import io.tiledb.cloud.rest_api.model.OrganizationUpdate; import io.tiledb.cloud.rest_api.model.OrganizationUser; @@ -79,7 +82,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -110,8 +113,8 @@ public okhttp3.Call addAWSAccessCredentialsCall(String workspace, String teamspa // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -135,31 +138,28 @@ public okhttp3.Call addAWSAccessCredentialsCall(String workspace, String teamspa localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addAWSAccessCredentialsValidateBeforeCall(String workspace, String teamspace, AWSAccessCredentials awsAccessCredentials, 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 addAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling addAWSAccessCredentials(Async)"); } - + // verify the required parameter 'awsAccessCredentials' is set if (awsAccessCredentials == null) { throw new ApiException("Missing the required parameter 'awsAccessCredentials' when calling addAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = addAWSAccessCredentialsCall(workspace, teamspace, awsAccessCredentials, _callback); - return localVarCall; + return addAWSAccessCredentialsCall(workspace, teamspace, awsAccessCredentials, _callback); } @@ -167,7 +167,7 @@ private okhttp3.Call addAWSAccessCredentialsValidateBeforeCall(String workspace, * * Add aws keys * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -186,7 +186,7 @@ public void addAWSAccessCredentials(String workspace, String teamspace, AWSAcces * * Add aws keys * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -207,7 +207,7 @@ public ApiResponse addAWSAccessCredentialsWithHttpInfo(String workspace, S * (asynchronously) * Add aws keys * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -259,7 +259,7 @@ public okhttp3.Call addUserToOrganizationCall(String organization, OrganizationU // create path and map variables String localVarPath = "/organizations/{organization}/user" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -283,26 +283,23 @@ public okhttp3.Call addUserToOrganizationCall(String organization, OrganizationU localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addUserToOrganizationValidateBeforeCall(String organization, OrganizationUser user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling addUserToOrganization(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling addUserToOrganization(Async)"); } - - okhttp3.Call localVarCall = addUserToOrganizationCall(organization, user, _callback); - return localVarCall; + return addUserToOrganizationCall(organization, user, _callback); } @@ -369,7 +366,7 @@ public okhttp3.Call addUserToOrganizationAsync(String organization, Organization /** * Build call for checkAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -399,8 +396,8 @@ public okhttp3.Call checkAWSAccessCredentialsCall(String workspace, String teams // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -417,33 +414,29 @@ public okhttp3.Call checkAWSAccessCredentialsCall(String workspace, String teams } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call checkAWSAccessCredentialsValidateBeforeCall(String workspace, 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 checkAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling checkAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = checkAWSAccessCredentialsCall(workspace, teamspace, _callback); - return localVarCall; + return checkAWSAccessCredentialsCall(workspace, teamspace, _callback); } @@ -451,7 +444,7 @@ private okhttp3.Call checkAWSAccessCredentialsValidateBeforeCall(String workspac * * Check if aws keys are set * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @return List<AWSAccessCredentials> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -471,7 +464,7 @@ public List checkAWSAccessCredentials(String workspace, St * * Check if aws keys are set * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @return ApiResponse<List<AWSAccessCredentials>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -492,7 +485,7 @@ public ApiResponse> checkAWSAccessCredentialsWithHttp * (asynchronously) * Check if aws keys are set * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (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 @@ -514,7 +507,7 @@ public okhttp3.Call checkAWSAccessCredentialsAsync(String workspace, String team /** * Build call for checkAWSAccessCredentialsByName * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -545,9 +538,9 @@ public okhttp3.Call checkAWSAccessCredentialsByNameCall(String workspace, String // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -564,38 +557,34 @@ public okhttp3.Call checkAWSAccessCredentialsByNameCall(String workspace, String } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call checkAWSAccessCredentialsByNameValidateBeforeCall(String workspace, String teamspace, String name, 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 checkAWSAccessCredentialsByName(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling checkAWSAccessCredentialsByName(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling checkAWSAccessCredentialsByName(Async)"); } - - okhttp3.Call localVarCall = checkAWSAccessCredentialsByNameCall(workspace, teamspace, name, _callback); - return localVarCall; + return checkAWSAccessCredentialsByNameCall(workspace, teamspace, name, _callback); } @@ -603,7 +592,7 @@ private okhttp3.Call checkAWSAccessCredentialsByNameValidateBeforeCall(String wo * * Check if aws keys are set by name * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @return AWSAccessCredentials * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -624,7 +613,7 @@ public AWSAccessCredentials checkAWSAccessCredentialsByName(String workspace, St * * Check if aws keys are set by name * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @return ApiResponse<AWSAccessCredentials> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -646,7 +635,7 @@ public ApiResponse checkAWSAccessCredentialsByNameWithHttp * (asynchronously) * Check if aws keys are set by name * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -698,8 +687,8 @@ public okhttp3.Call checkSSODomainCall(String organization, String uuid, final A // create path and map variables String localVarPath = "/organizations/{organization}/sso_domains/{uuid}/run_check" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "uuid" + "}", localVarApiClient.escapeString(uuid.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -716,33 +705,29 @@ public okhttp3.Call checkSSODomainCall(String organization, String uuid, final A } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call checkSSODomainValidateBeforeCall(String organization, String uuid, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling checkSSODomain(Async)"); } - + // verify the required parameter 'uuid' is set if (uuid == null) { throw new ApiException("Missing the required parameter 'uuid' when calling checkSSODomain(Async)"); } - - okhttp3.Call localVarCall = checkSSODomainCall(organization, uuid, _callback); - return localVarCall; + return checkSSODomainCall(organization, uuid, _callback); } @@ -862,21 +847,18 @@ public okhttp3.Call createOrganizationCall(Organization organization, final ApiC localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createOrganizationValidateBeforeCall(Organization organization, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling createOrganization(Async)"); } - - okhttp3.Call localVarCall = createOrganizationCall(organization, _callback); - return localVarCall; + return createOrganizationCall(organization, _callback); } @@ -969,7 +951,7 @@ public okhttp3.Call createSSODomainCall(String organization, SSODomainConfig con // create path and map variables String localVarPath = "/organizations/{organization}/sso_domain" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -993,26 +975,23 @@ public okhttp3.Call createSSODomainCall(String organization, SSODomainConfig con localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createSSODomainValidateBeforeCall(String organization, SSODomainConfig config, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling createSSODomain(Async)"); } - + // verify the required parameter 'config' is set if (config == null) { throw new ApiException("Missing the required parameter 'config' when calling createSSODomain(Async)"); } - - okhttp3.Call localVarCall = createSSODomainCall(organization, config, _callback); - return localVarCall; + return createSSODomainCall(organization, config, _callback); } @@ -1080,7 +1059,7 @@ public okhttp3.Call createSSODomainAsync(String organization, SSODomainConfig co /** * Build call for deleteAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -1111,9 +1090,9 @@ public okhttp3.Call deleteAWSAccessCredentialsCall(String workspace, String team // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1130,38 +1109,34 @@ public okhttp3.Call deleteAWSAccessCredentialsCall(String workspace, String team } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteAWSAccessCredentialsValidateBeforeCall(String workspace, String teamspace, String name, 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 deleteAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteAWSAccessCredentials(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = deleteAWSAccessCredentialsCall(workspace, teamspace, name, _callback); - return localVarCall; + return deleteAWSAccessCredentialsCall(workspace, teamspace, name, _callback); } @@ -1169,7 +1144,7 @@ private okhttp3.Call deleteAWSAccessCredentialsValidateBeforeCall(String workspa * * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1188,7 +1163,7 @@ public void deleteAWSAccessCredentials(String workspace, String teamspace, Strin * * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1209,7 +1184,7 @@ public ApiResponse deleteAWSAccessCredentialsWithHttpInfo(String workspace * (asynchronously) * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1260,7 +1235,7 @@ public okhttp3.Call deleteOrganizationCall(String organization, final ApiCallbac // create path and map variables String localVarPath = "/organizations/{organization}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1277,28 +1252,24 @@ public okhttp3.Call deleteOrganizationCall(String organization, final ApiCallbac } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteOrganizationValidateBeforeCall(String organization, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling deleteOrganization(Async)"); } - - okhttp3.Call localVarCall = deleteOrganizationCall(organization, _callback); - return localVarCall; + return deleteOrganizationCall(organization, _callback); } @@ -1391,8 +1362,8 @@ public okhttp3.Call deleteSSODomainCall(String organization, String uuid, final // create path and map variables String localVarPath = "/organizations/{organization}/sso_domains/{uuid}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "uuid" + "}", localVarApiClient.escapeString(uuid.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1409,33 +1380,29 @@ public okhttp3.Call deleteSSODomainCall(String organization, String uuid, final } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteSSODomainValidateBeforeCall(String organization, String uuid, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling deleteSSODomain(Async)"); } - + // verify the required parameter 'uuid' is set if (uuid == null) { throw new ApiException("Missing the required parameter 'uuid' when calling deleteSSODomain(Async)"); } - - okhttp3.Call localVarCall = deleteSSODomainCall(organization, uuid, _callback); - return localVarCall; + return deleteSSODomainCall(organization, uuid, _callback); } @@ -1529,8 +1496,8 @@ public okhttp3.Call deleteUserFromOrganizationCall(String organization, String u // create path and map variables String localVarPath = "/organizations/{organization}/{username}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1547,33 +1514,29 @@ public okhttp3.Call deleteUserFromOrganizationCall(String organization, String u } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserFromOrganizationValidateBeforeCall(String organization, String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling deleteUserFromOrganization(Async)"); } - + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUserFromOrganization(Async)"); } - - okhttp3.Call localVarCall = deleteUserFromOrganizationCall(organization, username, _callback); - return localVarCall; + return deleteUserFromOrganizationCall(organization, username, _callback); } @@ -1686,23 +1649,19 @@ public okhttp3.Call getAllOrganizationsCall(final ApiCallback _callback) throws } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getAllOrganizationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getAllOrganizationsCall(_callback); - return localVarCall; + return getAllOrganizationsCall(_callback); } @@ -1803,7 +1762,7 @@ public okhttp3.Call getOrganizationCall(String organization, final ApiCallback _ // create path and map variables String localVarPath = "/organizations/{organization}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1820,28 +1779,24 @@ public okhttp3.Call getOrganizationCall(String organization, final ApiCallback _ } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getOrganizationValidateBeforeCall(String organization, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling getOrganization(Async)"); } - - okhttp3.Call localVarCall = getOrganizationCall(organization, _callback); - return localVarCall; + return getOrganizationCall(organization, _callback); } @@ -1943,8 +1898,8 @@ public okhttp3.Call getOrganizationUserCall(String organization, String username // create path and map variables String localVarPath = "/organizations/{organization}/{username}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1961,33 +1916,29 @@ public okhttp3.Call getOrganizationUserCall(String organization, String username } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getOrganizationUserValidateBeforeCall(String organization, String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling getOrganizationUser(Async)"); } - + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getOrganizationUser(Async)"); } - - okhttp3.Call localVarCall = getOrganizationUserCall(organization, username, _callback); - return localVarCall; + return getOrganizationUserCall(organization, username, _callback); } @@ -2090,8 +2041,8 @@ public okhttp3.Call getSSODomainCall(String organization, String uuid, final Api // create path and map variables String localVarPath = "/organizations/{organization}/sso_domains/{uuid}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "uuid" + "}", localVarApiClient.escapeString(uuid.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2108,33 +2059,29 @@ public okhttp3.Call getSSODomainCall(String organization, String uuid, final Api } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getSSODomainValidateBeforeCall(String organization, String uuid, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling getSSODomain(Async)"); } - + // verify the required parameter 'uuid' is set if (uuid == null) { throw new ApiException("Missing the required parameter 'uuid' when calling getSSODomain(Async)"); } - - okhttp3.Call localVarCall = getSSODomainCall(organization, uuid, _callback); - return localVarCall; + return getSSODomainCall(organization, uuid, _callback); } @@ -2230,7 +2177,7 @@ public okhttp3.Call getSSODomainsCall(String organization, final ApiCallback _ca // create path and map variables String localVarPath = "/organizations/{organization}/sso_domains" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2247,28 +2194,24 @@ public okhttp3.Call getSSODomainsCall(String organization, final ApiCallback _ca } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getSSODomainsValidateBeforeCall(String organization, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling getSSODomains(Async)"); } - - okhttp3.Call localVarCall = getSSODomainsCall(organization, _callback); - return localVarCall; + return getSSODomainsCall(organization, _callback); } @@ -2333,7 +2276,7 @@ public okhttp3.Call getSSODomainsAsync(String organization, final ApiCallback localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2391,36 +2334,33 @@ public okhttp3.Call updateAWSAccessCredentialsCall(String workspace, String team localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateAWSAccessCredentialsValidateBeforeCall(String workspace, String teamspace, String name, AWSAccessCredentials awsAccessCredentials, 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 updateAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling updateAWSAccessCredentials(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling updateAWSAccessCredentials(Async)"); } - + // verify the required parameter 'awsAccessCredentials' is set if (awsAccessCredentials == null) { throw new ApiException("Missing the required parameter 'awsAccessCredentials' when calling updateAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = updateAWSAccessCredentialsCall(workspace, teamspace, name, awsAccessCredentials, _callback); - return localVarCall; + return updateAWSAccessCredentialsCall(workspace, teamspace, name, awsAccessCredentials, _callback); } @@ -2428,7 +2368,7 @@ private okhttp3.Call updateAWSAccessCredentialsValidateBeforeCall(String workspa * * Update aws keys or associated buckets. This will update the key associations for each array in the namespace * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -2448,7 +2388,7 @@ public void updateAWSAccessCredentials(String workspace, String teamspace, Strin * * Update aws keys or associated buckets. This will update the key associations for each array in the namespace * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @return ApiResponse<Void> @@ -2470,7 +2410,7 @@ public ApiResponse updateAWSAccessCredentialsWithHttpInfo(String workspace * (asynchronously) * Update aws keys or associated buckets. This will update the key associations for each array in the namespace * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @param _callback The callback to be executed when the API call finishes @@ -2523,7 +2463,7 @@ public okhttp3.Call updateOrganizationCall(String organization, OrganizationUpda // create path and map variables String localVarPath = "/organizations/{organization}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2547,26 +2487,23 @@ public okhttp3.Call updateOrganizationCall(String organization, OrganizationUpda localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateOrganizationValidateBeforeCall(String organization, OrganizationUpdate organizationDetails, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling updateOrganization(Async)"); } - + // verify the required parameter 'organizationDetails' is set if (organizationDetails == null) { throw new ApiException("Missing the required parameter 'organizationDetails' when calling updateOrganization(Async)"); } - - okhttp3.Call localVarCall = updateOrganizationCall(organization, organizationDetails, _callback); - return localVarCall; + return updateOrganizationCall(organization, organizationDetails, _callback); } @@ -2663,8 +2600,8 @@ public okhttp3.Call updateSSODomainCall(String organization, String uuid, SSODom // create path and map variables String localVarPath = "/organizations/{organization}/sso_domains/{uuid}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "uuid" + "\\}", localVarApiClient.escapeString(uuid.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "uuid" + "}", localVarApiClient.escapeString(uuid.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2688,31 +2625,28 @@ public okhttp3.Call updateSSODomainCall(String organization, String uuid, SSODom localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateSSODomainValidateBeforeCall(String organization, String uuid, SSODomainConfig config, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling updateSSODomain(Async)"); } - + // verify the required parameter 'uuid' is set if (uuid == null) { throw new ApiException("Missing the required parameter 'uuid' when calling updateSSODomain(Async)"); } - + // verify the required parameter 'config' is set if (config == null) { throw new ApiException("Missing the required parameter 'config' when calling updateSSODomain(Async)"); } - - okhttp3.Call localVarCall = updateSSODomainCall(organization, uuid, config, _callback); - return localVarCall; + return updateSSODomainCall(organization, uuid, config, _callback); } @@ -2814,8 +2748,8 @@ public okhttp3.Call updateUserInOrganizationCall(String organization, String use // create path and map variables String localVarPath = "/organizations/{organization}/{username}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2839,31 +2773,28 @@ public okhttp3.Call updateUserInOrganizationCall(String organization, String use localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateUserInOrganizationValidateBeforeCall(String organization, String username, OrganizationUser user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling updateUserInOrganization(Async)"); } - + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUserInOrganization(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling updateUserInOrganization(Async)"); } - - okhttp3.Call localVarCall = updateUserInOrganizationCall(organization, username, user, _callback); - return localVarCall; + return updateUserInOrganizationCall(organization, username, user, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/QueryApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/QueryApi.java index 7187ed1..c80420b 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/QueryApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/QueryApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import java.io.File; import io.tiledb.cloud.rest_api.model.Query; import io.tiledb.cloud.rest_api.model.QueryJson; @@ -112,9 +115,9 @@ public okhttp3.Call finalizeQueryCall(String workspace, String teamspace, String // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/query/finalize" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -139,7 +142,8 @@ public okhttp3.Call finalizeQueryCall(String workspace, String teamspace, String } final String[] localVarAccepts = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -147,53 +151,51 @@ public okhttp3.Call finalizeQueryCall(String workspace, String teamspace, String } final String[] localVarContentTypes = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call finalizeQueryValidateBeforeCall(String workspace, String teamspace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, 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 finalizeQuery(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling finalizeQuery(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling finalizeQuery(Async)"); } - + // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling finalizeQuery(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling finalizeQuery(Async)"); } - + // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling finalizeQuery(Async)"); } - - okhttp3.Call localVarCall = finalizeQueryCall(workspace, teamspace, array, type, contentType, query, xPayer, openAt, _callback); - return localVarCall; + return finalizeQueryCall(workspace, teamspace, array, type, contentType, query, xPayer, openAt, _callback); } @@ -322,9 +324,9 @@ public okhttp3.Call getEstResultSizesCall(String workspace, String teamspace, St // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/query/est_result_sizes" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -349,7 +351,8 @@ public okhttp3.Call getEstResultSizesCall(String workspace, String teamspace, St } final String[] localVarAccepts = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -357,53 +360,51 @@ public okhttp3.Call getEstResultSizesCall(String workspace, String teamspace, St } final String[] localVarContentTypes = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getEstResultSizesValidateBeforeCall(String workspace, String teamspace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, 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 getEstResultSizes(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getEstResultSizes(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getEstResultSizes(Async)"); } - + // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling getEstResultSizes(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling getEstResultSizes(Async)"); } - + // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling getEstResultSizes(Async)"); } - - okhttp3.Call localVarCall = getEstResultSizesCall(workspace, teamspace, array, type, contentType, query, xPayer, openAt, _callback); - return localVarCall; + return getEstResultSizesCall(workspace, teamspace, array, type, contentType, query, xPayer, openAt, _callback); } @@ -528,9 +529,9 @@ public okhttp3.Call getFileCall(String workspace, String teamspace, String array // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/query/get_file" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -555,43 +556,39 @@ public okhttp3.Call getFileCall(String workspace, String teamspace, String array } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getFileValidateBeforeCall(String workspace, String teamspace, String array, String contentType, String xPayer, 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 getFile(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling getFile(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling getFile(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling getFile(Async)"); } - - okhttp3.Call localVarCall = getFileCall(workspace, teamspace, array, contentType, xPayer, _callback); - return localVarCall; + return getFileCall(workspace, teamspace, array, contentType, xPayer, _callback); } @@ -708,9 +705,9 @@ public okhttp3.Call submitQueryCall(String workspace, String teamspace, String a // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/query/submit" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -735,7 +732,8 @@ public okhttp3.Call submitQueryCall(String workspace, String teamspace, String a } final String[] localVarAccepts = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -743,53 +741,51 @@ public okhttp3.Call submitQueryCall(String workspace, String teamspace, String a } final String[] localVarContentTypes = { - "application/json", "application/capnp" + "application/json", + "application/capnp" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitQueryValidateBeforeCall(String workspace, String teamspace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, 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 submitQuery(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling submitQuery(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling submitQuery(Async)"); } - + // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling submitQuery(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling submitQuery(Async)"); } - + // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling submitQuery(Async)"); } - - okhttp3.Call localVarCall = submitQueryCall(workspace, teamspace, array, type, contentType, query, xPayer, openAt, _callback); - return localVarCall; + return submitQueryCall(workspace, teamspace, array, type, contentType, query, xPayer, openAt, _callback); } @@ -915,9 +911,9 @@ public okhttp3.Call submitQueryJsonCall(String workspace, String teamspace, Stri // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/query/submit_query_json" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -949,41 +945,38 @@ public okhttp3.Call submitQueryJsonCall(String workspace, String teamspace, Stri localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitQueryJsonValidateBeforeCall(String workspace, String teamspace, String array, String contentType, QueryJson queryJson, String xPayer, 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 submitQueryJson(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling submitQueryJson(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling submitQueryJson(Async)"); } - + // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException("Missing the required parameter 'contentType' when calling submitQueryJson(Async)"); } - + // verify the required parameter 'queryJson' is set if (queryJson == null) { throw new ApiException("Missing the required parameter 'queryJson' when calling submitQueryJson(Async)"); } - - okhttp3.Call localVarCall = submitQueryJsonCall(workspace, teamspace, array, contentType, queryJson, xPayer, _callback); - return localVarCall; + return submitQueryJsonCall(workspace, teamspace, array, contentType, queryJson, xPayer, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApi.java index b6a522d..d4f950f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.RegisteredTaskGraph; import io.tiledb.cloud.rest_api.model.TaskGraphSharing; @@ -104,8 +107,8 @@ public okhttp3.Call deleteRegisteredTaskGraphCall(String workspace, String name, // create path and map variables String localVarPath = "/taskgraphs/{workspace}/registered/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -122,33 +125,29 @@ public okhttp3.Call deleteRegisteredTaskGraphCall(String workspace, String name, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegisteredTaskGraphValidateBeforeCall(String workspace, String name, 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 deleteRegisteredTaskGraph(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteRegisteredTaskGraph(Async)"); } - - okhttp3.Call localVarCall = deleteRegisteredTaskGraphCall(workspace, name, _callback); - return localVarCall; + return deleteRegisteredTaskGraphCall(workspace, name, _callback); } @@ -245,8 +244,8 @@ public okhttp3.Call getRegisteredTaskGraphCall(String workspace, String name, fi // create path and map variables String localVarPath = "/taskgraphs/{workspace}/registered/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -263,33 +262,29 @@ public okhttp3.Call getRegisteredTaskGraphCall(String workspace, String name, fi } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getRegisteredTaskGraphValidateBeforeCall(String workspace, String name, 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 getRegisteredTaskGraph(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getRegisteredTaskGraph(Async)"); } - - okhttp3.Call localVarCall = getRegisteredTaskGraphCall(workspace, name, _callback); - return localVarCall; + return getRegisteredTaskGraphCall(workspace, name, _callback); } @@ -391,8 +386,8 @@ public okhttp3.Call getRegisteredTaskGraphSharingPoliciesCall(String workspace, // create path and map variables String localVarPath = "/taskgraphs/{workspace}/registered/{name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -409,33 +404,29 @@ public okhttp3.Call getRegisteredTaskGraphSharingPoliciesCall(String workspace, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getRegisteredTaskGraphSharingPoliciesValidateBeforeCall(String workspace, String name, 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 getRegisteredTaskGraphSharingPolicies(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getRegisteredTaskGraphSharingPolicies(Async)"); } - - okhttp3.Call localVarCall = getRegisteredTaskGraphSharingPoliciesCall(workspace, name, _callback); - return localVarCall; + return getRegisteredTaskGraphSharingPoliciesCall(workspace, name, _callback); } @@ -540,8 +531,8 @@ public okhttp3.Call registerRegisteredTaskGraphCall(String workspace, String nam // create path and map variables String localVarPath = "/taskgraphs/{workspace}/registered/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -565,26 +556,23 @@ public okhttp3.Call registerRegisteredTaskGraphCall(String workspace, String nam localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call registerRegisteredTaskGraphValidateBeforeCall(String workspace, String name, RegisteredTaskGraph graph, 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 registerRegisteredTaskGraph(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling registerRegisteredTaskGraph(Async)"); } - - okhttp3.Call localVarCall = registerRegisteredTaskGraphCall(workspace, name, graph, _callback); - return localVarCall; + return registerRegisteredTaskGraphCall(workspace, name, graph, _callback); } @@ -686,8 +674,8 @@ public okhttp3.Call shareRegisteredTaskGraphCall(String workspace, String name, // create path and map variables String localVarPath = "/taskgraphs/{workspace}/registered/{name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -711,31 +699,28 @@ public okhttp3.Call shareRegisteredTaskGraphCall(String workspace, String name, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shareRegisteredTaskGraphValidateBeforeCall(String workspace, String name, TaskGraphSharing taskGraphSharing, 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 shareRegisteredTaskGraph(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling shareRegisteredTaskGraph(Async)"); } - + // verify the required parameter 'taskGraphSharing' is set if (taskGraphSharing == null) { throw new ApiException("Missing the required parameter 'taskGraphSharing' when calling shareRegisteredTaskGraph(Async)"); } - - okhttp3.Call localVarCall = shareRegisteredTaskGraphCall(workspace, name, taskGraphSharing, _callback); - return localVarCall; + return shareRegisteredTaskGraphCall(workspace, name, taskGraphSharing, _callback); } @@ -839,8 +824,8 @@ public okhttp3.Call updateRegisteredTaskGraphCall(String workspace, String name, // create path and map variables String localVarPath = "/taskgraphs/{workspace}/registered/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -864,26 +849,23 @@ public okhttp3.Call updateRegisteredTaskGraphCall(String workspace, String name, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateRegisteredTaskGraphValidateBeforeCall(String workspace, String name, RegisteredTaskGraph graph, 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 updateRegisteredTaskGraph(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling updateRegisteredTaskGraph(Async)"); } - - okhttp3.Call localVarCall = updateRegisteredTaskGraphCall(workspace, name, graph, _callback); - return localVarCall; + return updateRegisteredTaskGraphCall(workspace, name, graph, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/SqlApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/SqlApi.java index 82da371..13e46d2 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/SqlApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/SqlApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.SQLParameters; import java.lang.reflect.Type; @@ -73,7 +76,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for runSQL * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) * @param _callback Callback for upload/download progress @@ -106,8 +109,8 @@ public okhttp3.Call runSQLCall(String workspace, String teamspace, SQLParameters // create path and map variables String localVarPath = "/sql/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -135,31 +138,28 @@ public okhttp3.Call runSQLCall(String workspace, String teamspace, SQLParameters localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call runSQLValidateBeforeCall(String workspace, String teamspace, SQLParameters sql, String acceptEncoding, 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 runSQL(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling runSQL(Async)"); } - + // verify the required parameter 'sql' is set if (sql == null) { throw new ApiException("Missing the required parameter 'sql' when calling runSQL(Async)"); } - - okhttp3.Call localVarCall = runSQLCall(workspace, teamspace, sql, acceptEncoding, _callback); - return localVarCall; + return runSQLCall(workspace, teamspace, sql, acceptEncoding, _callback); } @@ -167,10 +167,10 @@ private okhttp3.Call runSQLValidateBeforeCall(String workspace, String teamspace * * Run a sql query * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) - * @return List<Object> + * @return List<Map<String, Object>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -181,8 +181,8 @@ private okhttp3.Call runSQLValidateBeforeCall(String workspace, String teamspace
0 error response -
*/ - public List runSQL(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { - ApiResponse> localVarResp = runSQLWithHttpInfo(workspace, teamspace, sql, acceptEncoding); + public List> runSQL(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { + ApiResponse>> localVarResp = runSQLWithHttpInfo(workspace, teamspace, sql, acceptEncoding); return localVarResp.getData(); } @@ -190,10 +190,10 @@ public List runSQL(String workspace, String teamspace, SQLParameters sql * * Run a sql query * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) - * @return ApiResponse<List<Object>> + * @return ApiResponse<List<Map<String, Object>>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -204,9 +204,9 @@ public List runSQL(String workspace, String teamspace, SQLParameters sql
0 error response -
*/ - public ApiResponse> runSQLWithHttpInfo(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { + public ApiResponse>> runSQLWithHttpInfo(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { okhttp3.Call localVarCall = runSQLValidateBeforeCall(workspace, teamspace, sql, acceptEncoding, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -214,7 +214,7 @@ public ApiResponse> runSQLWithHttpInfo(String workspace, String tea * (asynchronously) * Run a sql query * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) * @param _callback The callback to be executed when the API call finishes @@ -229,11 +229,54 @@ public ApiResponse> runSQLWithHttpInfo(String workspace, String tea 0 error response - */ - public okhttp3.Call runSQLAsync(String workspace, String teamspace, SQLParameters sql, String acceptEncoding, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call runSQLAsync(String workspace, String teamspace, SQLParameters sql, String acceptEncoding, final ApiCallback>> _callback) throws ApiException { okhttp3.Call localVarCall = runSQLValidateBeforeCall(workspace, teamspace, sql, acceptEncoding, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + + /** + * + * Run a sql query + * @param namespace namespace to run task under is in (an organization name or user's username) (required) + * @param sql sql being submitted (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse with byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 JSON results in array of objects form, if the query returns results * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
204 SQL executed successfully * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response -
+ */ + public ApiResponse runSQLWithHttpInfoBytes(String workspace, String namespace, SQLParameters sql, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = runSQLValidateBeforeCall(workspace, namespace, sql, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * Run a sql query + * @param namespace namespace to run task under is in (an organization name or user's username) (required) + * @param sql sql being submitted (required) + * @param acceptEncoding Encoding to use (optional) + * @return byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 JSON results in array of objects form, if the query returns results * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
204 SQL executed successfully * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response -
+ */ + public byte[] runSQLBytes(String workspace, String namespace, SQLParameters sql, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = runSQLWithHttpInfoBytes(workspace, namespace, sql, acceptEncoding); + return localVarResp.getData(); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/StatsApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/StatsApi.java index 43595f4..acc0f9e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/StatsApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/StatsApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.GetTiledbStats200Response; import java.lang.reflect.Type; @@ -117,23 +120,19 @@ public okhttp3.Call getTiledbStatsCall(final ApiCallback _callback) throws ApiEx } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getTiledbStatsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getTiledbStatsCall(_callback); - return localVarCall; + return getTiledbStatsCall(_callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApi.java index 3f89bae..9d8d43e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import java.time.OffsetDateTime; import io.tiledb.cloud.rest_api.model.TaskGraphClientNodeStatus; import io.tiledb.cloud.rest_api.model.TaskGraphLog; @@ -106,7 +109,7 @@ public okhttp3.Call createTaskGraphLogCall(String workspace, TaskGraphLog log, f // create path and map variables String localVarPath = "/taskgraphs/{workspace}/log" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -130,26 +133,23 @@ public okhttp3.Call createTaskGraphLogCall(String workspace, TaskGraphLog log, f localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createTaskGraphLogValidateBeforeCall(String workspace, TaskGraphLog log, 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 createTaskGraphLog(Async)"); } - + // verify the required parameter 'log' is set if (log == null) { throw new ApiException("Missing the required parameter 'log' when calling createTaskGraphLog(Async)"); } - - okhttp3.Call localVarCall = createTaskGraphLogCall(workspace, log, _callback); - return localVarCall; + return createTaskGraphLogCall(workspace, log, _callback); } @@ -250,8 +250,8 @@ public okhttp3.Call getTaskGraphLogCall(String workspace, String id, final ApiCa // create path and map variables String localVarPath = "/taskgraphs/{workspace}/logs/{id}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -268,33 +268,29 @@ public okhttp3.Call getTaskGraphLogCall(String workspace, String id, final ApiCa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getTaskGraphLogValidateBeforeCall(String workspace, String id, 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 getTaskGraphLog(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getTaskGraphLog(Async)"); } - - okhttp3.Call localVarCall = getTaskGraphLogCall(workspace, id, _callback); - return localVarCall; + return getTaskGraphLogCall(workspace, id, _callback); } @@ -449,23 +445,19 @@ public okhttp3.Call listTaskGraphLogsCall(String namespace, String createdBy, St } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listTaskGraphLogsValidateBeforeCall(String namespace, String createdBy, String status, String search, OffsetDateTime startTime, OffsetDateTime endTime, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = listTaskGraphLogsCall(namespace, createdBy, status, search, startTime, endTime, page, perPage, _callback); - return localVarCall; + return listTaskGraphLogsCall(namespace, createdBy, status, search, startTime, endTime, page, perPage, _callback); } @@ -585,8 +577,8 @@ public okhttp3.Call reportClientNodeCall(String workspace, String id, TaskGraphC // create path and map variables String localVarPath = "/taskgraphs/{workspace}/logs/{id}/report_client_node" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -610,31 +602,28 @@ public okhttp3.Call reportClientNodeCall(String workspace, String id, TaskGraphC localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call reportClientNodeValidateBeforeCall(String workspace, String id, TaskGraphClientNodeStatus report, 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 reportClientNode(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling reportClientNode(Async)"); } - + // verify the required parameter 'report' is set if (report == null) { throw new ApiException("Missing the required parameter 'report' when calling reportClientNode(Async)"); } - - okhttp3.Call localVarCall = reportClientNodeCall(workspace, id, report, _callback); - return localVarCall; + return reportClientNodeCall(workspace, id, report, _callback); } @@ -734,8 +723,8 @@ public okhttp3.Call resubmitTaskGraphExecutionCall(String workspace, String id, // create path and map variables String localVarPath = "/taskgraphs/{workspace}/executions/{id}/resubmit" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -752,33 +741,29 @@ public okhttp3.Call resubmitTaskGraphExecutionCall(String workspace, String id, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call resubmitTaskGraphExecutionValidateBeforeCall(String workspace, String id, 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 resubmitTaskGraphExecution(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling resubmitTaskGraphExecution(Async)"); } - - okhttp3.Call localVarCall = resubmitTaskGraphExecutionCall(workspace, id, _callback); - return localVarCall; + return resubmitTaskGraphExecutionCall(workspace, id, _callback); } @@ -879,8 +864,8 @@ public okhttp3.Call retryTaskGraphExecutionCall(String workspace, String id, fin // create path and map variables String localVarPath = "/taskgraphs/{workspace}/executions/{id}/retry" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -897,33 +882,29 @@ public okhttp3.Call retryTaskGraphExecutionCall(String workspace, String id, fin } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call retryTaskGraphExecutionValidateBeforeCall(String workspace, String id, 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 retryTaskGraphExecution(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling retryTaskGraphExecution(Async)"); } - - okhttp3.Call localVarCall = retryTaskGraphExecutionCall(workspace, id, _callback); - return localVarCall; + return retryTaskGraphExecutionCall(workspace, id, _callback); } @@ -1024,8 +1005,8 @@ public okhttp3.Call stopTaskGraphExecutionCall(String workspace, String id, fina // create path and map variables String localVarPath = "/taskgraphs/{workspace}/executions/{id}/stop" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1042,33 +1023,29 @@ public okhttp3.Call stopTaskGraphExecutionCall(String workspace, String id, fina } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call stopTaskGraphExecutionValidateBeforeCall(String workspace, String id, 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 stopTaskGraphExecution(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling stopTaskGraphExecution(Async)"); } - - okhttp3.Call localVarCall = stopTaskGraphExecutionCall(workspace, id, _callback); - return localVarCall; + return stopTaskGraphExecutionCall(workspace, id, _callback); } @@ -1166,8 +1143,8 @@ public okhttp3.Call submitTaskGraphCall(String workspace, String id, String root // create path and map variables String localVarPath = "/taskgraphs/{workspace}/graphs/{id}/submit" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1188,33 +1165,29 @@ public okhttp3.Call submitTaskGraphCall(String workspace, String id, String root } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitTaskGraphValidateBeforeCall(String workspace, String id, String rootTaskGraphUuid, 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 submitTaskGraph(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling submitTaskGraph(Async)"); } - - okhttp3.Call localVarCall = submitTaskGraphCall(workspace, id, rootTaskGraphUuid, _callback); - return localVarCall; + return submitTaskGraphCall(workspace, id, rootTaskGraphUuid, _callback); } @@ -1319,8 +1292,8 @@ public okhttp3.Call updateTaskGraphLogCall(String workspace, String id, TaskGrap // create path and map variables String localVarPath = "/taskgraphs/{workspace}/logs/{id}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1344,31 +1317,28 @@ public okhttp3.Call updateTaskGraphLogCall(String workspace, String id, TaskGrap localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateTaskGraphLogValidateBeforeCall(String workspace, String id, TaskGraphLog log, 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 updateTaskGraphLog(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling updateTaskGraphLog(Async)"); } - + // verify the required parameter 'log' is set if (log == null) { throw new ApiException("Missing the required parameter 'log' when calling updateTaskGraphLog(Async)"); } - - okhttp3.Call localVarCall = updateTaskGraphLogCall(workspace, id, log, _callback); - return localVarCall; + return updateTaskGraphLogCall(workspace, id, log, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphsApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphsApi.java index c3cd968..5642af4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphsApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/TaskGraphsApi.java @@ -19,12 +19,15 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.TaskGraph; import io.tiledb.cloud.rest_api.model.TaskGraphLog; import io.tiledb.cloud.rest_api.model.TaskGraphs; @@ -105,7 +108,7 @@ public okhttp3.Call createTaskGraphCall(String workspace, TaskGraph graph, final // create path and map variables String localVarPath = "/taskgraphs/{workspace}/graphs" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -129,26 +132,23 @@ public okhttp3.Call createTaskGraphCall(String workspace, TaskGraph graph, final localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createTaskGraphValidateBeforeCall(String workspace, TaskGraph graph, 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 createTaskGraph(Async)"); } - + // verify the required parameter 'graph' is set if (graph == null) { throw new ApiException("Missing the required parameter 'graph' when calling createTaskGraph(Async)"); } - - okhttp3.Call localVarCall = createTaskGraphCall(workspace, graph, _callback); - return localVarCall; + return createTaskGraphCall(workspace, graph, _callback); } @@ -249,8 +249,8 @@ public okhttp3.Call getTaskGraphCall(String workspace, String id, final ApiCallb // create path and map variables String localVarPath = "/taskgraphs/{workspace}/graphs/{id}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -267,33 +267,29 @@ public okhttp3.Call getTaskGraphCall(String workspace, String id, final ApiCallb } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getTaskGraphValidateBeforeCall(String workspace, String id, 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 getTaskGraph(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getTaskGraph(Async)"); } - - okhttp3.Call localVarCall = getTaskGraphCall(workspace, id, _callback); - return localVarCall; + return getTaskGraphCall(workspace, id, _callback); } @@ -393,7 +389,7 @@ public okhttp3.Call listTaskGraphsCall(String workspace, final ApiCallback _call // create path and map variables String localVarPath = "/taskgraphs/{workspace}/graphs" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -410,28 +406,24 @@ public okhttp3.Call listTaskGraphsCall(String workspace, final ApiCallback _call } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call listTaskGraphsValidateBeforeCall(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 listTaskGraphs(Async)"); } - - okhttp3.Call localVarCall = listTaskGraphsCall(workspace, _callback); - return localVarCall; + return listTaskGraphsCall(workspace, _callback); } @@ -530,8 +522,8 @@ public okhttp3.Call submitTaskGraphCall(String workspace, String id, String root // create path and map variables String localVarPath = "/taskgraphs/{workspace}/graphs/{id}/submit" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -552,33 +544,29 @@ public okhttp3.Call submitTaskGraphCall(String workspace, String id, String root } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitTaskGraphValidateBeforeCall(String workspace, String id, String rootTaskGraphUuid, 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 submitTaskGraph(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling submitTaskGraph(Async)"); } - - okhttp3.Call localVarCall = submitTaskGraphCall(workspace, id, rootTaskGraphUuid, _callback); - return localVarCall; + return submitTaskGraphCall(workspace, id, rootTaskGraphUuid, _callback); } @@ -683,8 +671,8 @@ public okhttp3.Call updateTaskGraphCall(String workspace, String id, TaskGraph g // create path and map variables String localVarPath = "/taskgraphs/{workspace}/graphs/{id}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -708,31 +696,28 @@ public okhttp3.Call updateTaskGraphCall(String workspace, String id, TaskGraph g localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateTaskGraphValidateBeforeCall(String workspace, String id, TaskGraph graph, 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 updateTaskGraph(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling updateTaskGraph(Async)"); } - + // verify the required parameter 'graph' is set if (graph == null) { throw new ApiException("Missing the required parameter 'graph' when calling updateTaskGraph(Async)"); } - - okhttp3.Call localVarCall = updateTaskGraphCall(workspace, id, graph, _callback); - return localVarCall; + return updateTaskGraphCall(workspace, id, graph, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/TasksApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/TasksApi.java index 8f62002..3b9c052 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/TasksApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/TasksApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -27,6 +29,7 @@ import io.tiledb.cloud.rest_api.model.ArrayTask; import io.tiledb.cloud.rest_api.model.ArrayTaskData; +import io.tiledb.cloud.rest_api.model.Error; import io.tiledb.cloud.rest_api.model.SQLParameters; import java.lang.reflect.Type; @@ -75,7 +78,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for runSQL * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) * @param _callback Callback for upload/download progress @@ -108,8 +111,8 @@ public okhttp3.Call runSQLCall(String workspace, String teamspace, SQLParameters // create path and map variables String localVarPath = "/sql/{workspace}/{teamspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -137,31 +140,28 @@ public okhttp3.Call runSQLCall(String workspace, String teamspace, SQLParameters localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call runSQLValidateBeforeCall(String workspace, String teamspace, SQLParameters sql, String acceptEncoding, 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 runSQL(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling runSQL(Async)"); } - + // verify the required parameter 'sql' is set if (sql == null) { throw new ApiException("Missing the required parameter 'sql' when calling runSQL(Async)"); } - - okhttp3.Call localVarCall = runSQLCall(workspace, teamspace, sql, acceptEncoding, _callback); - return localVarCall; + return runSQLCall(workspace, teamspace, sql, acceptEncoding, _callback); } @@ -169,10 +169,10 @@ private okhttp3.Call runSQLValidateBeforeCall(String workspace, String teamspace * * Run a sql query * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) - * @return List<Object> + * @return List<Map<String, Object>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -183,8 +183,8 @@ private okhttp3.Call runSQLValidateBeforeCall(String workspace, String teamspace
0 error response -
*/ - public List runSQL(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { - ApiResponse> localVarResp = runSQLWithHttpInfo(workspace, teamspace, sql, acceptEncoding); + public List> runSQL(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { + ApiResponse>> localVarResp = runSQLWithHttpInfo(workspace, teamspace, sql, acceptEncoding); return localVarResp.getData(); } @@ -192,10 +192,10 @@ public List runSQL(String workspace, String teamspace, SQLParameters sql * * Run a sql query * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) - * @return ApiResponse<List<Object>> + * @return ApiResponse<List<Map<String, Object>>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -206,9 +206,9 @@ public List runSQL(String workspace, String teamspace, SQLParameters sql
0 error response -
*/ - public ApiResponse> runSQLWithHttpInfo(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { + public ApiResponse>> runSQLWithHttpInfo(String workspace, String teamspace, SQLParameters sql, String acceptEncoding) throws ApiException { okhttp3.Call localVarCall = runSQLValidateBeforeCall(workspace, teamspace, sql, acceptEncoding, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -216,7 +216,7 @@ public ApiResponse> runSQLWithHttpInfo(String workspace, String tea * (asynchronously) * Run a sql query * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the sql query belongs to (required) * @param sql sql being submitted (required) * @param acceptEncoding Encoding to use (optional) * @param _callback The callback to be executed when the API call finishes @@ -231,10 +231,10 @@ public ApiResponse> runSQLWithHttpInfo(String workspace, String tea 0 error response - */ - public okhttp3.Call runSQLAsync(String workspace, String teamspace, SQLParameters sql, String acceptEncoding, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call runSQLAsync(String workspace, String teamspace, SQLParameters sql, String acceptEncoding, final ApiCallback>> _callback) throws ApiException { okhttp3.Call localVarCall = runSQLValidateBeforeCall(workspace, teamspace, sql, acceptEncoding, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -270,7 +270,7 @@ public okhttp3.Call taskIdGetCall(String id, final ApiCallback _callback) throws // create path and map variables String localVarPath = "/task/{id}" - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -287,28 +287,24 @@ public okhttp3.Call taskIdGetCall(String id, final ApiCallback _callback) throws } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call taskIdGetValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling taskIdGet(Async)"); } - - okhttp3.Call localVarCall = taskIdGetCall(id, _callback); - return localVarCall; + return taskIdGetCall(id, _callback); } @@ -408,7 +404,7 @@ public okhttp3.Call taskIdResultGetCall(String id, String acceptEncoding, final // create path and map variables String localVarPath = "/task/{id}/result" - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -429,28 +425,24 @@ public okhttp3.Call taskIdResultGetCall(String id, String acceptEncoding, final } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call taskIdResultGetValidateBeforeCall(String id, String acceptEncoding, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling taskIdResultGet(Async)"); } - - okhttp3.Call localVarCall = taskIdResultGetCall(id, acceptEncoding, _callback); - return localVarCall; + return taskIdResultGetCall(id, acceptEncoding, _callback); } @@ -641,23 +633,19 @@ public okhttp3.Call tasksGetCall(String namespace, String createdBy, String arra } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call tasksGetValidateBeforeCall(String namespace, String createdBy, String array, Integer start, Integer end, Integer page, Integer perPage, String type, List excludeType, List fileType, List excludeFileType, String status, String search, String orderby, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = tasksGetCall(namespace, createdBy, array, start, end, page, perPage, type, excludeType, fileType, excludeFileType, status, search, orderby, _callback); - return localVarCall; + return tasksGetCall(namespace, createdBy, array, start, end, page, perPage, type, excludeType, fileType, excludeFileType, status, search, orderby, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/UdfApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/UdfApi.java index b018cbb..8ddb5bc 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/UdfApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/UdfApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -26,7 +28,7 @@ import io.tiledb.cloud.rest_api.model.ArrayEndTimestampData; - +import io.tiledb.cloud.rest_api.model.Error; import java.io.File; import io.tiledb.cloud.rest_api.model.GenericUDF; import io.tiledb.cloud.rest_api.model.MultiArrayUDF; @@ -112,8 +114,8 @@ public okhttp3.Call deleteUDFInfoCall(String workspace, String name, final ApiCa // create path and map variables String localVarPath = "/udf/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -130,33 +132,29 @@ public okhttp3.Call deleteUDFInfoCall(String workspace, String name, final ApiCa } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteUDFInfoValidateBeforeCall(String workspace, String name, 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 deleteUDFInfo(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteUDFInfo(Async)"); } - - okhttp3.Call localVarCall = deleteUDFInfoCall(workspace, name, _callback); - return localVarCall; + return deleteUDFInfoCall(workspace, name, _callback); } @@ -254,8 +252,8 @@ public okhttp3.Call getUDFInfoCall(String workspace, String name, final ApiCallb // create path and map variables String localVarPath = "/udf/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -272,33 +270,29 @@ public okhttp3.Call getUDFInfoCall(String workspace, String name, final ApiCallb } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getUDFInfoValidateBeforeCall(String workspace, String name, 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 getUDFInfo(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getUDFInfo(Async)"); } - - okhttp3.Call localVarCall = getUDFInfoCall(workspace, name, _callback); - return localVarCall; + return getUDFInfoCall(workspace, name, _callback); } @@ -403,8 +397,8 @@ public okhttp3.Call getUDFInfoSharingPoliciesCall(String workspace, String name, // create path and map variables String localVarPath = "/udf/{workspace}/{name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -421,33 +415,29 @@ public okhttp3.Call getUDFInfoSharingPoliciesCall(String workspace, String name, } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getUDFInfoSharingPoliciesValidateBeforeCall(String workspace, String name, 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 getUDFInfoSharingPolicies(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling getUDFInfoSharingPolicies(Async)"); } - - okhttp3.Call localVarCall = getUDFInfoSharingPoliciesCall(workspace, name, _callback); - return localVarCall; + return getUDFInfoSharingPoliciesCall(workspace, name, _callback); } @@ -554,8 +544,8 @@ public okhttp3.Call handleCopyUDFCall(String workspace, String name, UDFCopy udF // create path and map variables String localVarPath = "/udf/{workspace}/{name}/copy" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -587,31 +577,28 @@ public okhttp3.Call handleCopyUDFCall(String workspace, String name, UDFCopy udF localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call handleCopyUDFValidateBeforeCall(String workspace, String name, UDFCopy udFCopy, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, 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 handleCopyUDF(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling handleCopyUDF(Async)"); } - + // verify the required parameter 'udFCopy' is set if (udFCopy == null) { throw new ApiException("Missing the required parameter 'udFCopy' when calling handleCopyUDF(Async)"); } - - okhttp3.Call localVarCall = handleCopyUDFCall(workspace, name, udFCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp, _callback); - return localVarCall; + return handleCopyUDFCall(workspace, name, udFCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp, _callback); } @@ -722,8 +709,8 @@ public okhttp3.Call registerUDFInfoCall(String workspace, String name, UDFInfoUp // create path and map variables String localVarPath = "/udf/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -747,31 +734,28 @@ public okhttp3.Call registerUDFInfoCall(String workspace, String name, UDFInfoUp localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call registerUDFInfoValidateBeforeCall(String workspace, String name, UDFInfoUpdate udf, 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 registerUDFInfo(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling registerUDFInfo(Async)"); } - + // verify the required parameter 'udf' is set if (udf == null) { throw new ApiException("Missing the required parameter 'udf' when calling registerUDFInfo(Async)"); } - - okhttp3.Call localVarCall = registerUDFInfoCall(workspace, name, udf, _callback); - return localVarCall; + return registerUDFInfoCall(workspace, name, udf, _callback); } @@ -873,8 +857,8 @@ public okhttp3.Call shareUDFInfoCall(String workspace, String name, UDFSharing u // create path and map variables String localVarPath = "/udf/{workspace}/{name}/share" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -898,31 +882,28 @@ public okhttp3.Call shareUDFInfoCall(String workspace, String name, UDFSharing u localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call shareUDFInfoValidateBeforeCall(String workspace, String name, UDFSharing udfSharing, 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 shareUDFInfo(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling shareUDFInfo(Async)"); } - + // verify the required parameter 'udfSharing' is set if (udfSharing == null) { throw new ApiException("Missing the required parameter 'udfSharing' when calling shareUDFInfo(Async)"); } - - okhttp3.Call localVarCall = shareUDFInfoCall(workspace, name, udfSharing, _callback); - return localVarCall; + return shareUDFInfoCall(workspace, name, udfSharing, _callback); } @@ -1026,7 +1007,7 @@ public okhttp3.Call submitGenericUDFCall(String workspace, GenericUDF udf, Strin // create path and map variables String localVarPath = "/udfs/generic/{workspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1054,26 +1035,23 @@ public okhttp3.Call submitGenericUDFCall(String workspace, GenericUDF udf, Strin localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitGenericUDFValidateBeforeCall(String workspace, GenericUDF udf, String acceptEncoding, 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 submitGenericUDF(Async)"); } - + // verify the required parameter 'udf' is set if (udf == null) { throw new ApiException("Missing the required parameter 'udf' when calling submitGenericUDF(Async)"); } - - okhttp3.Call localVarCall = submitGenericUDFCall(workspace, udf, acceptEncoding, _callback); - return localVarCall; + return submitGenericUDFCall(workspace, udf, acceptEncoding, _callback); } @@ -1178,7 +1156,7 @@ public okhttp3.Call submitMultiArrayUDFCall(String workspace, MultiArrayUDF udf, // create path and map variables String localVarPath = "/udfs/arrays/{workspace}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1206,26 +1184,23 @@ public okhttp3.Call submitMultiArrayUDFCall(String workspace, MultiArrayUDF udf, localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitMultiArrayUDFValidateBeforeCall(String workspace, MultiArrayUDF udf, String acceptEncoding, 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 submitMultiArrayUDF(Async)"); } - + // verify the required parameter 'udf' is set if (udf == null) { throw new ApiException("Missing the required parameter 'udf' when calling submitMultiArrayUDF(Async)"); } - - okhttp3.Call localVarCall = submitMultiArrayUDFCall(workspace, udf, acceptEncoding, _callback); - return localVarCall; + return submitMultiArrayUDFCall(workspace, udf, acceptEncoding, _callback); } @@ -1334,9 +1309,9 @@ public okhttp3.Call submitUDFCall(String workspace, String teamspace, String arr // create path and map variables String localVarPath = "/arrays/{workspace}/{teamspace}/{array}/udf/submit" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1372,36 +1347,33 @@ public okhttp3.Call submitUDFCall(String workspace, String teamspace, String arr localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call submitUDFValidateBeforeCall(String workspace, String teamspace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2, 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 submitUDF(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling submitUDF(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling submitUDF(Async)"); } - + // verify the required parameter 'udf' is set if (udf == null) { throw new ApiException("Missing the required parameter 'udf' when calling submitUDF(Async)"); } - - okhttp3.Call localVarCall = submitUDFCall(workspace, teamspace, array, udf, xPayer, acceptEncoding, v2, _callback); - return localVarCall; + return submitUDFCall(workspace, teamspace, array, udf, xPayer, acceptEncoding, v2, _callback); } @@ -1519,8 +1491,8 @@ public okhttp3.Call udfWorkspaceArrayEndTimestampsGetCall(String workspace, Stri // create path and map variables String localVarPath = "/udf/{workspace}/{array}/end_timestamps" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "array" + "}", localVarApiClient.escapeString(array.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1545,33 +1517,29 @@ public okhttp3.Call udfWorkspaceArrayEndTimestampsGetCall(String workspace, Stri } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call udfWorkspaceArrayEndTimestampsGetValidateBeforeCall(String workspace, String array, Integer page, 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 udfWorkspaceArrayEndTimestampsGet(Async)"); } - + // verify the required parameter 'array' is set if (array == null) { throw new ApiException("Missing the required parameter 'array' when calling udfWorkspaceArrayEndTimestampsGet(Async)"); } - - okhttp3.Call localVarCall = udfWorkspaceArrayEndTimestampsGetCall(workspace, array, page, perPage, _callback); - return localVarCall; + return udfWorkspaceArrayEndTimestampsGetCall(workspace, array, page, perPage, _callback); } @@ -1679,8 +1647,8 @@ public okhttp3.Call updateUDFInfoCall(String workspace, String name, UDFInfoUpda // create path and map variables String localVarPath = "/udf/{workspace}/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1704,31 +1672,28 @@ public okhttp3.Call updateUDFInfoCall(String workspace, String name, UDFInfoUpda localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateUDFInfoValidateBeforeCall(String workspace, String name, UDFInfoUpdate udf, 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 updateUDFInfo(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling updateUDFInfo(Async)"); } - + // verify the required parameter 'udf' is set if (udf == null) { throw new ApiException("Missing the required parameter 'udf' when calling updateUDFInfo(Async)"); } - - okhttp3.Call localVarCall = updateUDFInfoCall(workspace, name, udf, _callback); - return localVarCall; + return updateUDFInfoCall(workspace, name, udf, _callback); } @@ -1795,4 +1760,303 @@ public okhttp3.Call updateUDFInfoAsync(String workspace, String name, UDFInfoUpd localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + + /** + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitGenericUDFWithHttpInfoString(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public String submitGenericUDFString(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = submitGenericUDFWithHttpInfoString(namespace, udf, acceptEncoding); + return localVarResp.getData(); + } + + /** + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public byte[] submitGenericUDFBytes(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = submitGenericUDFWithHttpInfoBytes(namespace, udf, acceptEncoding); + return localVarResp.getData(); + } + + /** + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<byte[]> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitGenericUDFWithHttpInfoBytes(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public Object submitGenericUDFObj(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = submitGenericUDFWithHttpInfoObj(namespace, udf, acceptEncoding); + return localVarResp.getData(); + } + + /** + * + * submit a generic UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitGenericUDFWithHttpInfoObj(String namespace, GenericUDF udf, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = submitGenericUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public String submitMultiArrayUDFString(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = submitMultiArrayUDFWithHttpInfoString(namespace, udf, acceptEncoding); + return localVarResp.getData(); + } + + /** + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitMultiArrayUDFWithHttpInfoString(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = submitMultiArrayUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public byte[] submitMultiArrayUDFBytes(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { + ApiResponse localVarResp = submitMultiArrayUDFWithHttpInfoBytes(namespace, udf, acceptEncoding); + return localVarResp.getData(); + } + + /** + * + * submit a multi-array UDF in the given namespace + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param udf UDF to run (required) + * @param acceptEncoding Encoding to use (optional) + * @return ApiResponse<byte[]> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitMultiArrayUDFWithHttpInfoBytes(String namespace, MultiArrayUDF udf, String acceptEncoding) throws ApiException { + okhttp3.Call localVarCall = submitMultiArrayUDFValidateBeforeCall(namespace, udf, acceptEncoding, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * send a UDF to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param udf UDF to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param acceptEncoding Encoding to use (optional) + * @param v2 flag to indicate if v2 array UDFs should be used, currently in beta testing. Setting any value will enable v2 array UDFs. (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public String submitUDFString(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + ApiResponse localVarResp = submitUDFWithHttpInfoString(workspace, namespace, array, udf, xPayer, acceptEncoding, v2); + return localVarResp.getData(); + } + + /** + * + * send a UDF to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param udf UDF to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param acceptEncoding Encoding to use (optional) + * @param v2 flag to indicate if v2 array UDFs should be used, currently in beta testing. Setting any value will enable v2 array UDFs. (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitUDFWithHttpInfoString(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + okhttp3.Call localVarCall = submitUDFValidateBeforeCall(workspace, namespace, array, udf, xPayer, acceptEncoding, v2, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * + * send a UDF to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param udf UDF to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param acceptEncoding Encoding to use (optional) + * @param v2 flag to indicate if v2 array UDFs should be used, currently in beta testing. Setting any value will enable v2 array UDFs. (optional) + * @return byte[] + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public byte[] submitUDFBytes(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + ApiResponse localVarResp = submitUDFWithHttpInfoBytes(workspace, namespace, array, udf, xPayer, acceptEncoding, v2); + return localVarResp.getData(); + } + + /** + * + * send a UDF to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param udf UDF to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param acceptEncoding Encoding to use (optional) + * @param v2 flag to indicate if v2 array UDFs should be used, currently in beta testing. Setting any value will enable v2 array UDFs. (optional) + * @return ApiResponse<byte[]> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 UDF completed and the UDF-type specific result is returned * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
0 error response * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed request
+ */ + public ApiResponse submitUDFWithHttpInfoBytes(String workspace, String namespace, String array, MultiArrayUDF udf, String xPayer, String acceptEncoding, String v2) throws ApiException { + okhttp3.Call localVarCall = submitUDFValidateBeforeCall(workspace, namespace, array, udf, xPayer, acceptEncoding, v2, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/api/UserApi.java b/src/main/java/io/tiledb/cloud/rest_api/api/UserApi.java index 260add0..fc844c5 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/api/UserApi.java +++ b/src/main/java/io/tiledb/cloud/rest_api/api/UserApi.java @@ -19,6 +19,8 @@ import io.tiledb.cloud.rest_api.ApiResponse; import io.tiledb.cloud.rest_api.Configuration; import io.tiledb.cloud.rest_api.Pair; +import io.tiledb.cloud.rest_api.ProgressRequestBody; +import io.tiledb.cloud.rest_api.ProgressResponseBody; import com.google.gson.reflect.TypeToken; @@ -26,7 +28,7 @@ import io.tiledb.cloud.rest_api.model.AWSAccessCredentials; - +import io.tiledb.cloud.rest_api.model.Error; import java.time.OffsetDateTime; import io.tiledb.cloud.rest_api.model.OrganizationUser; import io.tiledb.cloud.rest_api.model.ResetUserPasswordRequest; @@ -81,7 +83,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -112,8 +114,8 @@ public okhttp3.Call addAWSAccessCredentialsCall(String workspace, String teamspa // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -137,31 +139,28 @@ public okhttp3.Call addAWSAccessCredentialsCall(String workspace, String teamspa localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addAWSAccessCredentialsValidateBeforeCall(String workspace, String teamspace, AWSAccessCredentials awsAccessCredentials, 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 addAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling addAWSAccessCredentials(Async)"); } - + // verify the required parameter 'awsAccessCredentials' is set if (awsAccessCredentials == null) { throw new ApiException("Missing the required parameter 'awsAccessCredentials' when calling addAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = addAWSAccessCredentialsCall(workspace, teamspace, awsAccessCredentials, _callback); - return localVarCall; + return addAWSAccessCredentialsCall(workspace, teamspace, awsAccessCredentials, _callback); } @@ -169,7 +168,7 @@ private okhttp3.Call addAWSAccessCredentialsValidateBeforeCall(String workspace, * * Add aws keys * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -188,7 +187,7 @@ public void addAWSAccessCredentials(String workspace, String teamspace, AWSAcces * * Add aws keys * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -209,7 +208,7 @@ public ApiResponse addAWSAccessCredentialsWithHttpInfo(String workspace, S * (asynchronously) * Add aws keys * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param awsAccessCredentials aws access credentials to store for a namespace (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -261,7 +260,7 @@ public okhttp3.Call addUserToOrganizationCall(String organization, OrganizationU // create path and map variables String localVarPath = "/organizations/{organization}/user" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -285,26 +284,23 @@ public okhttp3.Call addUserToOrganizationCall(String organization, OrganizationU localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addUserToOrganizationValidateBeforeCall(String organization, OrganizationUser user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling addUserToOrganization(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling addUserToOrganization(Async)"); } - - okhttp3.Call localVarCall = addUserToOrganizationCall(organization, user, _callback); - return localVarCall; + return addUserToOrganizationCall(organization, user, _callback); } @@ -371,7 +367,7 @@ public okhttp3.Call addUserToOrganizationAsync(String organization, Organization /** * Build call for checkAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -401,8 +397,8 @@ public okhttp3.Call checkAWSAccessCredentialsCall(String workspace, String teams // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -419,33 +415,29 @@ public okhttp3.Call checkAWSAccessCredentialsCall(String workspace, String teams } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call checkAWSAccessCredentialsValidateBeforeCall(String workspace, 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 checkAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling checkAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = checkAWSAccessCredentialsCall(workspace, teamspace, _callback); - return localVarCall; + return checkAWSAccessCredentialsCall(workspace, teamspace, _callback); } @@ -453,7 +445,7 @@ private okhttp3.Call checkAWSAccessCredentialsValidateBeforeCall(String workspac * * Check if aws keys are set * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @return List<AWSAccessCredentials> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -473,7 +465,7 @@ public List checkAWSAccessCredentials(String workspace, St * * Check if aws keys are set * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @return ApiResponse<List<AWSAccessCredentials>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -494,7 +486,7 @@ public ApiResponse> checkAWSAccessCredentialsWithHttp * (asynchronously) * Check if aws keys are set * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (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 @@ -516,7 +508,7 @@ public okhttp3.Call checkAWSAccessCredentialsAsync(String workspace, String team /** * Build call for checkAWSAccessCredentialsByName * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -547,9 +539,9 @@ public okhttp3.Call checkAWSAccessCredentialsByNameCall(String workspace, String // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -566,38 +558,34 @@ public okhttp3.Call checkAWSAccessCredentialsByNameCall(String workspace, String } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call checkAWSAccessCredentialsByNameValidateBeforeCall(String workspace, String teamspace, String name, 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 checkAWSAccessCredentialsByName(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling checkAWSAccessCredentialsByName(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling checkAWSAccessCredentialsByName(Async)"); } - - okhttp3.Call localVarCall = checkAWSAccessCredentialsByNameCall(workspace, teamspace, name, _callback); - return localVarCall; + return checkAWSAccessCredentialsByNameCall(workspace, teamspace, name, _callback); } @@ -605,7 +593,7 @@ private okhttp3.Call checkAWSAccessCredentialsByNameValidateBeforeCall(String wo * * Check if aws keys are set by name * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @return AWSAccessCredentials * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -626,7 +614,7 @@ public AWSAccessCredentials checkAWSAccessCredentialsByName(String workspace, St * * Check if aws keys are set by name * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @return ApiResponse<AWSAccessCredentials> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -648,7 +636,7 @@ public ApiResponse checkAWSAccessCredentialsByNameWithHttp * (asynchronously) * Check if aws keys are set by name * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -715,23 +703,19 @@ public okhttp3.Call confirmEmailCall(final ApiCallback _callback) throws ApiExce } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call confirmEmailValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = confirmEmailCall(_callback); - return localVarCall; + return confirmEmailCall(_callback); } @@ -844,21 +828,18 @@ public okhttp3.Call createUserCall(User user, final ApiCallback _callback) throw localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - - okhttp3.Call localVarCall = createUserCall(user, _callback); - return localVarCall; + return createUserCall(user, _callback); } @@ -922,7 +903,7 @@ public okhttp3.Call createUserAsync(User user, final ApiCallback _callback /** * Build call for deleteAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -953,9 +934,9 @@ public okhttp3.Call deleteAWSAccessCredentialsCall(String workspace, String team // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -972,38 +953,34 @@ public okhttp3.Call deleteAWSAccessCredentialsCall(String workspace, String team } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteAWSAccessCredentialsValidateBeforeCall(String workspace, String teamspace, String name, 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 deleteAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling deleteAWSAccessCredentials(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling deleteAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = deleteAWSAccessCredentialsCall(workspace, teamspace, name, _callback); - return localVarCall; + return deleteAWSAccessCredentialsCall(workspace, teamspace, name, _callback); } @@ -1011,7 +988,7 @@ private okhttp3.Call deleteAWSAccessCredentialsValidateBeforeCall(String workspa * * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1030,7 +1007,7 @@ public void deleteAWSAccessCredentials(String workspace, String teamspace, Strin * * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1051,7 +1028,7 @@ public ApiResponse deleteAWSAccessCredentialsWithHttpInfo(String workspace * (asynchronously) * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -1102,7 +1079,7 @@ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) // create path and map variables String localVarPath = "/users/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1119,28 +1096,24 @@ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); } - - okhttp3.Call localVarCall = deleteUserCall(username, _callback); - return localVarCall; + return deleteUserCall(username, _callback); } @@ -1234,8 +1207,8 @@ public okhttp3.Call deleteUserFromOrganizationCall(String organization, String u // create path and map variables String localVarPath = "/organizations/{organization}/{username}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1252,33 +1225,29 @@ public okhttp3.Call deleteUserFromOrganizationCall(String organization, String u } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserFromOrganizationValidateBeforeCall(String organization, String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling deleteUserFromOrganization(Async)"); } - + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUserFromOrganization(Async)"); } - - okhttp3.Call localVarCall = deleteUserFromOrganizationCall(organization, username, _callback); - return localVarCall; + return deleteUserFromOrganizationCall(organization, username, _callback); } @@ -1376,8 +1345,8 @@ public okhttp3.Call getOrganizationUserCall(String organization, String username // create path and map variables String localVarPath = "/organizations/{organization}/{username}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1394,33 +1363,29 @@ public okhttp3.Call getOrganizationUserCall(String organization, String username } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getOrganizationUserValidateBeforeCall(String organization, String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling getOrganizationUser(Async)"); } - + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getOrganizationUser(Async)"); } - - okhttp3.Call localVarCall = getOrganizationUserCall(organization, username, _callback); - return localVarCall; + return getOrganizationUserCall(organization, username, _callback); } @@ -1548,23 +1513,19 @@ public okhttp3.Call getSessionCall(String rememberMe, OffsetDateTime expires, fi } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getSessionValidateBeforeCall(String rememberMe, OffsetDateTime expires, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getSessionCall(rememberMe, expires, _callback); - return localVarCall; + return getSessionCall(rememberMe, expires, _callback); } @@ -1679,23 +1640,19 @@ public okhttp3.Call getTokenScopesCall(final ApiCallback _callback) throws ApiEx } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getTokenScopesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getTokenScopesCall(_callback); - return localVarCall; + return getTokenScopesCall(_callback); } @@ -1804,23 +1761,19 @@ public okhttp3.Call getUserCall(final ApiCallback _callback) throws ApiException } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getUserCall(_callback); - return localVarCall; + return getUserCall(_callback); } @@ -1915,7 +1868,7 @@ public okhttp3.Call getUserWithUsernameCall(String username, final ApiCallback _ // create path and map variables String localVarPath = "/users/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1932,28 +1885,24 @@ public okhttp3.Call getUserWithUsernameCall(String username, final ApiCallback _ } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getUserWithUsernameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getUserWithUsername(Async)"); } - - okhttp3.Call localVarCall = getUserWithUsernameCall(username, _callback); - return localVarCall; + return getUserWithUsernameCall(username, _callback); } @@ -2076,16 +2025,13 @@ public okhttp3.Call requestTokenCall(TokenRequest tokenRequest, final ApiCallbac localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call requestTokenValidateBeforeCall(TokenRequest tokenRequest, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = requestTokenCall(tokenRequest, _callback); - return localVarCall; + return requestTokenCall(tokenRequest, _callback); } @@ -2206,21 +2152,18 @@ public okhttp3.Call resetUserPasswordCall(ResetUserPasswordRequest user, final A localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call resetUserPasswordValidateBeforeCall(ResetUserPasswordRequest user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling resetUserPassword(Async)"); } - - okhttp3.Call localVarCall = resetUserPasswordCall(user, _callback); - return localVarCall; + return resetUserPasswordCall(user, _callback); } @@ -2316,7 +2259,7 @@ public okhttp3.Call revokeTokenCall(String token, final ApiCallback _callback) t // create path and map variables String localVarPath = "/tokens/{token}" - .replaceAll("\\{" + "token" + "\\}", localVarApiClient.escapeString(token.toString())); + .replace("{" + "token" + "}", localVarApiClient.escapeString(token.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2333,28 +2276,24 @@ public okhttp3.Call revokeTokenCall(String token, final ApiCallback _callback) t } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call revokeTokenValidateBeforeCall(String token, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'token' is set if (token == null) { throw new ApiException("Missing the required parameter 'token' when calling revokeToken(Async)"); } - - okhttp3.Call localVarCall = revokeTokenCall(token, _callback); - return localVarCall; + return revokeTokenCall(token, _callback); } @@ -2462,23 +2401,19 @@ public okhttp3.Call tokensGetCall(final ApiCallback _callback) throws ApiExcepti } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call tokensGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = tokensGetCall(_callback); - return localVarCall; + return tokensGetCall(_callback); } @@ -2587,23 +2522,19 @@ public okhttp3.Call tokensSessionGetCall(final ApiCallback _callback) throws Api } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call tokensSessionGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = tokensSessionGetCall(_callback); - return localVarCall; + return tokensSessionGetCall(_callback); } @@ -2668,7 +2599,7 @@ public okhttp3.Call tokensSessionGetAsync(final ApiCallback> _callba /** * Build call for updateAWSAccessCredentials * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @param _callback Callback for upload/download progress @@ -2700,9 +2631,9 @@ public okhttp3.Call updateAWSAccessCredentialsCall(String workspace, String team // create path and map variables String localVarPath = "/credentials/{workspace}/{teamspace}/aws/{name}" - .replaceAll("\\{" + "workspace" + "\\}", localVarApiClient.escapeString(workspace.toString())) - .replaceAll("\\{" + "teamspace" + "\\}", localVarApiClient.escapeString(teamspace.toString())) - .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())); + .replace("{" + "workspace" + "}", localVarApiClient.escapeString(workspace.toString())) + .replace("{" + "teamspace" + "}", localVarApiClient.escapeString(teamspace.toString())) + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2726,36 +2657,33 @@ public okhttp3.Call updateAWSAccessCredentialsCall(String workspace, String team localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateAWSAccessCredentialsValidateBeforeCall(String workspace, String teamspace, String name, AWSAccessCredentials awsAccessCredentials, 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 updateAWSAccessCredentials(Async)"); } - + // verify the required parameter 'teamspace' is set if (teamspace == null) { throw new ApiException("Missing the required parameter 'teamspace' when calling updateAWSAccessCredentials(Async)"); } - + // verify the required parameter 'name' is set if (name == null) { throw new ApiException("Missing the required parameter 'name' when calling updateAWSAccessCredentials(Async)"); } - + // verify the required parameter 'awsAccessCredentials' is set if (awsAccessCredentials == null) { throw new ApiException("Missing the required parameter 'awsAccessCredentials' when calling updateAWSAccessCredentials(Async)"); } - - okhttp3.Call localVarCall = updateAWSAccessCredentialsCall(workspace, teamspace, name, awsAccessCredentials, _callback); - return localVarCall; + return updateAWSAccessCredentialsCall(workspace, teamspace, name, awsAccessCredentials, _callback); } @@ -2763,7 +2691,7 @@ private okhttp3.Call updateAWSAccessCredentialsValidateBeforeCall(String workspa * * Update aws keys or associated buckets. This will update the key associations for each array in the namespace * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -2783,7 +2711,7 @@ public void updateAWSAccessCredentials(String workspace, String teamspace, Strin * * Update aws keys or associated buckets. This will update the key associations for each array in the namespace * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @return ApiResponse<Void> @@ -2805,7 +2733,7 @@ public ApiResponse updateAWSAccessCredentialsWithHttpInfo(String workspace * (asynchronously) * Update aws keys or associated buckets. This will update the key associations for each array in the namespace * @param workspace the workspace containing the teamspace the array belongs to (required) - * @param teamspace the teamspace the array belongs to (required) + * @param teamspace the teamspace the credentials belongs to (required) * @param name name (required) * @param awsAccessCredentials aws credentials to update (required) * @param _callback The callback to be executed when the API call finishes @@ -2858,7 +2786,7 @@ public okhttp3.Call updateUserCall(String username, User user, final ApiCallback // create path and map variables String localVarPath = "/users/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2882,26 +2810,23 @@ public okhttp3.Call updateUserCall(String username, User user, final ApiCallback localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); } - - okhttp3.Call localVarCall = updateUserCall(username, user, _callback); - return localVarCall; + return updateUserCall(username, user, _callback); } @@ -2999,8 +2924,8 @@ public okhttp3.Call updateUserInOrganizationCall(String organization, String use // create path and map variables String localVarPath = "/organizations/{organization}/{username}" - .replaceAll("\\{" + "organization" + "\\}", localVarApiClient.escapeString(organization.toString())) - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "organization" + "}", localVarApiClient.escapeString(organization.toString())) + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3024,31 +2949,28 @@ public okhttp3.Call updateUserInOrganizationCall(String organization, String use localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + String[] localVarAuthNames = new String[] { "BasicAuth", "ApiKeyAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateUserInOrganizationValidateBeforeCall(String organization, String username, OrganizationUser user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organization' is set if (organization == null) { throw new ApiException("Missing the required parameter 'organization' when calling updateUserInOrganization(Async)"); } - + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUserInOrganization(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling updateUserInOrganization(Async)"); } - - okhttp3.Call localVarCall = updateUserInOrganizationCall(organization, username, user, _callback); - return localVarCall; + return updateUserInOrganizationCall(organization, username, user, _callback); } diff --git a/src/main/java/io/tiledb/cloud/rest_api/auth/ApiKeyAuth.java b/src/main/java/io/tiledb/cloud/rest_api/auth/ApiKeyAuth.java index bcd4cf4..627b54c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/auth/ApiKeyAuth.java +++ b/src/main/java/io/tiledb/cloud/rest_api/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBasicAuth.java b/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBasicAuth.java index 4abe027..1ff06ac 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBasicAuth.java +++ b/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBearerAuth.java b/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBearerAuth.java index b2ccd72..46f32ff 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBearerAuth.java +++ b/src/main/java/io/tiledb/cloud/rest_api/auth/HttpBearerAuth.java @@ -17,13 +17,15 @@ import io.tiledb.cloud.rest_api.Pair; import java.net.URI; -import java.util.Map; 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", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -35,7 +37,7 @@ public HttpBearerAuth(String scheme) { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -44,12 +46,22 @@ public String getBearerToken() { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = 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; } diff --git a/src/main/java/io/tiledb/cloud/rest_api/auth/OAuth.java b/src/main/java/io/tiledb/cloud/rest_api/auth/OAuth.java index 978ca5c..a103a4c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/auth/OAuth.java +++ b/src/main/java/io/tiledb/cloud/rest_api/auth/OAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class OAuth implements Authentication { private String accessToken; diff --git a/src/main/java/io/tiledb/cloud/rest_api/auth/OAuthFlow.java b/src/main/java/io/tiledb/cloud/rest_api/auth/OAuthFlow.java index 89259b0..32dc3fb 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/auth/OAuthFlow.java +++ b/src/main/java/io/tiledb/cloud/rest_api/auth/OAuthFlow.java @@ -16,7 +16,7 @@ /** * OAuth flows that are supported by this client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public enum OAuthFlow { ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 IMPLICIT, diff --git a/src/main/java/io/tiledb/cloud/rest_api/auth/RetryingOAuth.java b/src/main/java/io/tiledb/cloud/rest_api/auth/RetryingOAuth.java index acfd332..f945585 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/auth/RetryingOAuth.java +++ b/src/main/java/io/tiledb/cloud/rest_api/auth/RetryingOAuth.java @@ -65,8 +65,8 @@ public RetryingOAuth( .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } @@ -129,8 +129,8 @@ private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAut } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentials.java b/src/main/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentials.java index 28dd72b..f09d23d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentials.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentials.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +52,7 @@ /** * Model representing aws keys or service role, service roles are currently ignored, but will be preferred option in the future */ -@ApiModel(description = "Model representing aws keys or service role, service roles are currently ignored, but will be preferred option in the future") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class AWSAccessCredentials { public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) @@ -69,7 +76,7 @@ public class AWSAccessCredentials { public static final String SERIALIZED_NAME_BUCKETS = "buckets"; @SerializedName(SERIALIZED_NAME_BUCKETS) - private List buckets = null; + private List buckets = new ArrayList<>(); public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; @SerializedName(SERIALIZED_NAME_CREATED_AT) @@ -79,10 +86,9 @@ public class AWSAccessCredentials { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public AWSAccessCredentials() { + public AWSAccessCredentials() { } - public AWSAccessCredentials( OffsetDateTime createdAt, OffsetDateTime updatedAt @@ -93,122 +99,101 @@ public AWSAccessCredentials( } public AWSAccessCredentials secretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; return this; } - /** + /** * aws secret access key, never returned in get requests * @return secretAccessKey - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "aws secret access key, never returned in get requests") - public String getSecretAccessKey() { return secretAccessKey; } - public void setSecretAccessKey(String secretAccessKey) { this.secretAccessKey = secretAccessKey; } public AWSAccessCredentials accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; return this; } - /** + /** * aws access key * @return accessKeyId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "aws access key") - public String getAccessKeyId() { return accessKeyId; } - public void setAccessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; } public AWSAccessCredentials serviceRoleArn(String serviceRoleArn) { - this.serviceRoleArn = serviceRoleArn; return this; } - /** + /** * aws service role to use for access * @return serviceRoleArn - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "aws service role to use for access") - public String getServiceRoleArn() { return serviceRoleArn; } - public void setServiceRoleArn(String serviceRoleArn) { this.serviceRoleArn = serviceRoleArn; } public AWSAccessCredentials name(String name) { - this.name = name; return this; } - /** + /** * human readable name * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "human readable name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public AWSAccessCredentials _default(Boolean _default) { - this._default = _default; return this; } - /** + /** * true if this is the default credential to be used within this namespace * @return _default - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "true if this is the default credential to be used within this namespace") - public Boolean getDefault() { return _default; } - public void setDefault(Boolean _default) { this._default = _default; } public AWSAccessCredentials buckets(List buckets) { - this.buckets = buckets; return this; } @@ -221,86 +206,42 @@ public AWSAccessCredentials addBucketsItem(String bucketsItem) { return this; } - /** + /** * a whitelist of one or more buckets this key should access * @return buckets - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "a whitelist of one or more buckets this key should access") - public List getBuckets() { return buckets; } - public void setBuckets(List buckets) { this.buckets = buckets; } - /** + /** * Time when UDF dependencies were created (rfc3339) * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time when UDF dependencies were created (rfc3339)") - public OffsetDateTime getCreatedAt() { return createdAt; } - - /** + /** * Time when UDF dependencies was last updated (rfc3339) * @return updatedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time when UDF dependencies was last updated (rfc3339)") - public OffsetDateTime getUpdatedAt() { return updatedAt; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public AWSAccessCredentials putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - @Override public boolean equals(Object o) { @@ -318,13 +259,12 @@ public boolean equals(Object o) { Objects.equals(this._default, awSAccessCredentials._default) && Objects.equals(this.buckets, awSAccessCredentials.buckets) && Objects.equals(this.createdAt, awSAccessCredentials.createdAt) && - Objects.equals(this.updatedAt, awSAccessCredentials.updatedAt)&& - Objects.equals(this.additionalProperties, awSAccessCredentials.additionalProperties); + Objects.equals(this.updatedAt, awSAccessCredentials.updatedAt); } @Override public int hashCode() { - return Objects.hash(secretAccessKey, accessKeyId, serviceRoleArn, name, _default, buckets, createdAt, updatedAt, additionalProperties); + return Objects.hash(secretAccessKey, accessKeyId, serviceRoleArn, name, _default, buckets, createdAt, updatedAt); } @Override @@ -339,7 +279,6 @@ public String toString() { sb.append(" buckets: ").append(toIndentedString(buckets)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -375,34 +314,41 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AWSAccessCredentials - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AWSAccessCredentials.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 AWSAccessCredentials + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AWSAccessCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in AWSAccessCredentials is not found in the empty JSON string", AWSAccessCredentials.openapiRequiredFields.toString())); } } - if (jsonObj.get("secret_access_key") != null && !jsonObj.get("secret_access_key").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AWSAccessCredentials.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AWSAccessCredentials` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("access_key_id") != null && !jsonObj.get("access_key_id").isJsonPrimitive()) { + 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("service_role_arn") != null && !jsonObj.get("service_role_arn").isJsonPrimitive()) { + if ((jsonObj.get("service_role_arn") != null && !jsonObj.get("service_role_arn").isJsonNull()) && !jsonObj.get("service_role_arn").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `service_role_arn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service_role_arn").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } - // ensure the json data is an array - if (jsonObj.get("buckets") != null && !jsonObj.get("buckets").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("buckets") != null && !jsonObj.get("buckets").isJsonNull() && !jsonObj.get("buckets").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `buckets` to be an array in the JSON string but got `%s`", jsonObj.get("buckets").toString())); } } @@ -422,71 +368,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AWSAccessCredentials value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public AWSAccessCredentials read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - AWSAccessCredentials instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of AWSAccessCredentials given an JSON string - * - * @param jsonString JSON string - * @return An instance of AWSAccessCredentials - * @throws IOException if the JSON string is invalid with respect to AWSAccessCredentials - */ + /** + * Create an instance of AWSAccessCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of AWSAccessCredentials + * @throws IOException if the JSON string is invalid with respect to AWSAccessCredentials + */ public static AWSAccessCredentials fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AWSAccessCredentials.class); } - /** - * Convert an instance of AWSAccessCredentials to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AWSAccessCredentials 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/model/AbstractOpenApiSchema.java b/src/main/java/io/tiledb/cloud/rest_api/model/AbstractOpenApiSchema.java index e26aec3..7cb0532 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AbstractOpenApiSchema.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AbstractOpenApiSchema.java @@ -13,17 +13,15 @@ package io.tiledb.cloud.rest_api.model; +import io.tiledb.cloud.rest_api.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; - -//import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -45,7 +43,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/ActivityEventType.java b/src/main/java/io/tiledb/cloud/rest_api/model/ActivityEventType.java index a6fb118..e1a957a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ActivityEventType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ActivityEventType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -98,5 +99,10 @@ public ActivityEventType read(final JsonReader jsonReader) throws IOException { return ActivityEventType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ActivityEventType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/Array.java b/src/main/java/io/tiledb/cloud/rest_api/model/Array.java index 3973a23..984822f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Array.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Array.java @@ -14,27 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Querytype; import java.io.IOException; import java.math.BigDecimal; +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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +51,7 @@ /** * Represents an open array */ -@ApiModel(description = "Represents an open array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Array { public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; @SerializedName(SERIALIZED_NAME_TIMESTAMP) @@ -57,112 +65,65 @@ public class Array { @SerializedName(SERIALIZED_NAME_URI) private String uri; - public Array() { + public Array() { } public Array timestamp(BigDecimal timestamp) { - this.timestamp = timestamp; return this; } - /** + /** * timestamp (epoch milliseconds) array is opened at * @return timestamp - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "1540471791873", required = true, value = "timestamp (epoch milliseconds) array is opened at") - public BigDecimal getTimestamp() { return timestamp; } - public void setTimestamp(BigDecimal timestamp) { this.timestamp = timestamp; } public Array queryType(Querytype queryType) { - this.queryType = queryType; return this; } - /** + /** * Get queryType * @return queryType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Querytype getQueryType() { return queryType; } - public void setQueryType(Querytype queryType) { this.queryType = queryType; } public Array uri(String uri) { - this.uri = uri; return this; } - /** + /** * Array uri * @return uri - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array uri") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Array putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -176,13 +137,12 @@ public boolean equals(Object o) { Array array = (Array) o; return Objects.equals(this.timestamp, array.timestamp) && Objects.equals(this.queryType, array.queryType) && - Objects.equals(this.uri, array.uri)&& - Objects.equals(this.additionalProperties, array.additionalProperties); + Objects.equals(this.uri, array.uri); } @Override public int hashCode() { - return Objects.hash(timestamp, queryType, uri, additionalProperties); + return Objects.hash(timestamp, queryType, uri); } @Override @@ -192,7 +152,6 @@ public String toString() { sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); sb.append(" queryType: ").append(toIndentedString(queryType)).append("\n"); sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -226,28 +185,37 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("uri"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Array - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Array.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Array + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Array.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Array is not found in the empty JSON string", Array.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Array.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Array` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Array.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `queryType` + Querytype.validateJsonElement(jsonObj.get("queryType")); + 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())); } } @@ -267,71 +235,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Array value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Array read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Array instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Array given an JSON string - * - * @param jsonString JSON string - * @return An instance of Array - * @throws IOException if the JSON string is invalid with respect to Array - */ + /** + * Create an instance of Array given an JSON string + * + * @param jsonString JSON string + * @return An instance of Array + * @throws IOException if the JSON string is invalid with respect to Array + */ public static Array fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Array.class); } - /** - * Convert an instance of Array to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Array 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/model/ArrayActions.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActions.java index 0b59ed7..a45a6cf 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActions.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActions.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -76,5 +77,10 @@ public ArrayActions read(final JsonReader jsonReader) throws IOException { return ArrayActions.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ArrayActions.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActivityLog.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActivityLog.java index a3f0228..66ad986 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActivityLog.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayActivityLog.java @@ -14,27 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ActivityEventType; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +51,7 @@ /** * Actvity of an Array */ -@ApiModel(description = "Actvity of an Array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayActivityLog { public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; @SerializedName(SERIALIZED_NAME_EVENT_AT) @@ -81,250 +89,179 @@ public class ArrayActivityLog { @SerializedName(SERIALIZED_NAME_QUERY_STATS) private String queryStats; - public ArrayActivityLog() { + public ArrayActivityLog() { } public ArrayActivityLog eventAt(OffsetDateTime eventAt) { - this.eventAt = eventAt; return this; } - /** + /** * time event took place (RFC3339) * @return eventAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "time event took place (RFC3339)") - public OffsetDateTime getEventAt() { return eventAt; } - public void setEventAt(OffsetDateTime eventAt) { this.eventAt = eventAt; } public ArrayActivityLog action(ActivityEventType action) { - this.action = action; return this; } - /** + /** * Get action * @return action - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ActivityEventType getAction() { return action; } - public void setAction(ActivityEventType action) { this.action = action; } public ArrayActivityLog username(String username) { - this.username = username; return this; } - /** + /** * User who performed action * @return username - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "user1", value = "User who performed action") - public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } public ArrayActivityLog bytesSent(Integer bytesSent) { - this.bytesSent = bytesSent; return this; } - /** + /** * Bytes sent to client * @return bytesSent - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "Bytes sent to client") - public Integer getBytesSent() { return bytesSent; } - public void setBytesSent(Integer bytesSent) { this.bytesSent = bytesSent; } public ArrayActivityLog bytesReceived(Integer bytesReceived) { - this.bytesReceived = bytesReceived; return this; } - /** + /** * Bytes recieved from client * @return bytesReceived - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "Bytes recieved from client") - public Integer getBytesReceived() { return bytesReceived; } - public void setBytesReceived(Integer bytesReceived) { this.bytesReceived = bytesReceived; } public ArrayActivityLog arrayTaskId(String arrayTaskId) { - this.arrayTaskId = arrayTaskId; return this; } - /** + /** * UUID of associated array task * @return arrayTaskId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "UUID of associated array task") - public String getArrayTaskId() { return arrayTaskId; } - public void setArrayTaskId(String arrayTaskId) { this.arrayTaskId = arrayTaskId; } public ArrayActivityLog id(String id) { - this.id = id; return this; } - /** + /** * ID of the activity * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "ID of the activity") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public ArrayActivityLog queryRanges(String queryRanges) { - this.queryRanges = queryRanges; return this; } - /** + /** * ranges for query * @return queryRanges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "{\"rows\":[{\"start\": 1, \"end\": 1},{\"start\": 3, \"end\": 4}],\"cols\":[{\"start\": 1, \"end\": 4}]}", value = "ranges for query") - public String getQueryRanges() { return queryRanges; } - public void setQueryRanges(String queryRanges) { this.queryRanges = queryRanges; } public ArrayActivityLog queryStats(String queryStats) { - this.queryStats = queryStats; return this; } - /** + /** * stats for query * @return queryStats - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "{\"timers\": {\"Context.StorageManager.read_load_array_schema_from_uri.sum\": 0.0255293, \"...\": \"...\"}, \"counters\": {\"Context.StorageManager.read_unfiltered_byte_num\": 191, \"...\": \"...\"}}", value = "stats for query") - public String getQueryStats() { return queryStats; } - public void setQueryStats(String queryStats) { this.queryStats = queryStats; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayActivityLog putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -344,13 +281,12 @@ public boolean equals(Object o) { Objects.equals(this.arrayTaskId, arrayActivityLog.arrayTaskId) && Objects.equals(this.id, arrayActivityLog.id) && Objects.equals(this.queryRanges, arrayActivityLog.queryRanges) && - Objects.equals(this.queryStats, arrayActivityLog.queryStats)&& - Objects.equals(this.additionalProperties, arrayActivityLog.additionalProperties); + Objects.equals(this.queryStats, arrayActivityLog.queryStats); } @Override public int hashCode() { - return Objects.hash(eventAt, action, username, bytesSent, bytesReceived, arrayTaskId, id, queryRanges, queryStats, additionalProperties); + return Objects.hash(eventAt, action, username, bytesSent, bytesReceived, arrayTaskId, id, queryRanges, queryStats); } @Override @@ -366,7 +302,6 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" queryRanges: ").append(toIndentedString(queryRanges)).append("\n"); sb.append(" queryStats: ").append(toIndentedString(queryStats)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -403,33 +338,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayActivityLog - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayActivityLog.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayActivityLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayActivityLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayActivityLog is not found in the empty JSON string", ArrayActivityLog.openapiRequiredFields.toString())); } } - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayActivityLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayActivityLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `action` + if (jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) { + ActivityEventType.validateJsonElement(jsonObj.get("action")); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !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("array_task_id") != null && !jsonObj.get("array_task_id").isJsonPrimitive()) { + if ((jsonObj.get("array_task_id") != null && !jsonObj.get("array_task_id").isJsonNull()) && !jsonObj.get("array_task_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_task_id").toString())); } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + 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())); } - if (jsonObj.get("query_ranges") != null && !jsonObj.get("query_ranges").isJsonPrimitive()) { + if ((jsonObj.get("query_ranges") != null && !jsonObj.get("query_ranges").isJsonNull()) && !jsonObj.get("query_ranges").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `query_ranges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query_ranges").toString())); } - if (jsonObj.get("query_stats") != null && !jsonObj.get("query_stats").isJsonPrimitive()) { + if ((jsonObj.get("query_stats") != null && !jsonObj.get("query_stats").isJsonNull()) && !jsonObj.get("query_stats").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `query_stats` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query_stats").toString())); } } @@ -449,71 +395,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayActivityLog value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayActivityLog read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayActivityLog instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayActivityLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayActivityLog - * @throws IOException if the JSON string is invalid with respect to ArrayActivityLog - */ + /** + * Create an instance of ArrayActivityLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayActivityLog + * @throws IOException if the JSON string is invalid with respect to ArrayActivityLog + */ public static ArrayActivityLog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayActivityLog.class); } - /** - * Convert an instance of ArrayActivityLog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayActivityLog 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/model/ArrayBrowserData.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayBrowserData.java index 3162ead..0b4195e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayBrowserData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayBrowserData.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Object including array info and pagination metadata */ -@ApiModel(description = "Object including array info and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayBrowserData { public static final String SERIALIZED_NAME_ARRAYS = "arrays"; @SerializedName(SERIALIZED_NAME_ARRAYS) - private List arrays = null; + private List arrays = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public ArrayBrowserData() { + public ArrayBrowserData() { } public ArrayBrowserData arrays(List arrays) { - this.arrays = arrays; return this; } @@ -72,80 +79,38 @@ public ArrayBrowserData addArraysItem(ArrayInfo arraysItem) { return this; } - /** + /** * Array Info * @return arrays - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Array Info") - public List getArrays() { return arrays; } - public void setArrays(List arrays) { this.arrays = arrays; } public ArrayBrowserData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayBrowserData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } ArrayBrowserData arrayBrowserData = (ArrayBrowserData) o; return Objects.equals(this.arrays, arrayBrowserData.arrays) && - Objects.equals(this.paginationMetadata, arrayBrowserData.paginationMetadata)&& - Objects.equals(this.additionalProperties, arrayBrowserData.additionalProperties); + Objects.equals(this.paginationMetadata, arrayBrowserData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(arrays, paginationMetadata, additionalProperties); + return Objects.hash(arrays, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class ArrayBrowserData {\n"); sb.append(" arrays: ").append(toIndentedString(arrays)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayBrowserData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayBrowserData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayBrowserData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayBrowserData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayBrowserData is not found in the empty JSON string", ArrayBrowserData.openapiRequiredFields.toString())); } } - JsonArray jsonArrayarrays = jsonObj.getAsJsonArray("arrays"); - if (jsonArrayarrays != null) { - // ensure the json data is an array - if (!jsonObj.get("arrays").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `arrays` to be an array in the JSON string but got `%s`", jsonObj.get("arrays").toString())); - } - // validate the optional field `arrays` (array) - for (int i = 0; i < jsonArrayarrays.size(); i++) { - ArrayInfo.validateJsonObject(jsonArrayarrays.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayBrowserData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayBrowserData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("arrays") != null && !jsonObj.get("arrays").isJsonNull()) { + JsonArray jsonArrayarrays = jsonObj.getAsJsonArray("arrays"); + if (jsonArrayarrays != null) { + // ensure the json data is an array + if (!jsonObj.get("arrays").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrays` to be an array in the JSON string but got `%s`", jsonObj.get("arrays").toString())); + } + + // validate the optional field `arrays` (array) + for (int i = 0; i < jsonArrayarrays.size(); i++) { + ArrayInfo.validateJsonElement(jsonArrayarrays.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayBrowserData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayBrowserData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayBrowserData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayBrowserData given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayBrowserData - * @throws IOException if the JSON string is invalid with respect to ArrayBrowserData - */ + /** + * Create an instance of ArrayBrowserData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayBrowserData + * @throws IOException if the JSON string is invalid with respect to ArrayBrowserData + */ public static ArrayBrowserData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayBrowserData.class); } - /** - * Convert an instance of ArrayBrowserData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayBrowserData 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/model/ArrayBrowserSidebar.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebar.java index 3c2260d..199d5c2 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebar.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebar.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,12 +51,11 @@ /** * Object for ui array tasks browser page */ -@ApiModel(description = "Object for ui array tasks browser page") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayBrowserSidebar { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces = null; + private List namespaces = new ArrayList<>(); public static final String SERIALIZED_NAME_RESULT_COUNT_FOR_ALL = "result_count_for_all"; @SerializedName(SERIALIZED_NAME_RESULT_COUNT_FOR_ALL) @@ -58,11 +65,10 @@ public class ArrayBrowserSidebar { @SerializedName(SERIALIZED_NAME_RESULT_COUNT_BY_NAMESPACE) private Object resultCountByNamespace; - public ArrayBrowserSidebar() { + public ArrayBrowserSidebar() { } public ArrayBrowserSidebar namespaces(List namespaces) { - this.namespaces = namespaces; return this; } @@ -75,103 +81,57 @@ public ArrayBrowserSidebar addNamespacesItem(String namespacesItem) { return this; } - /** + /** * list of all unique namespaces to display * @return namespaces - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of all unique namespaces to display") - public List getNamespaces() { return namespaces; } - public void setNamespaces(List namespaces) { this.namespaces = namespaces; } public ArrayBrowserSidebar resultCountForAll(Integer resultCountForAll) { - this.resultCountForAll = resultCountForAll; return this; } - /** + /** * A count of \"all\" of category * @return resultCountForAll - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A count of \"all\" of category") - public Integer getResultCountForAll() { return resultCountForAll; } - public void setResultCountForAll(Integer resultCountForAll) { this.resultCountForAll = resultCountForAll; } public ArrayBrowserSidebar resultCountByNamespace(Object resultCountByNamespace) { - this.resultCountByNamespace = resultCountByNamespace; return this; } - /** + /** * A map that includes the result count by namespace * @return resultCountByNamespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A map that includes the result count by namespace") - public Object getResultCountByNamespace() { return resultCountByNamespace; } - public void setResultCountByNamespace(Object resultCountByNamespace) { this.resultCountByNamespace = resultCountByNamespace; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayBrowserSidebar putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -185,13 +145,12 @@ public boolean equals(Object o) { ArrayBrowserSidebar arrayBrowserSidebar = (ArrayBrowserSidebar) o; return Objects.equals(this.namespaces, arrayBrowserSidebar.namespaces) && Objects.equals(this.resultCountForAll, arrayBrowserSidebar.resultCountForAll) && - Objects.equals(this.resultCountByNamespace, arrayBrowserSidebar.resultCountByNamespace)&& - Objects.equals(this.additionalProperties, arrayBrowserSidebar.additionalProperties); + Objects.equals(this.resultCountByNamespace, arrayBrowserSidebar.resultCountByNamespace); } @Override public int hashCode() { - return Objects.hash(namespaces, resultCountForAll, resultCountByNamespace, additionalProperties); + return Objects.hash(namespaces, resultCountForAll, resultCountByNamespace); } @Override @@ -201,7 +160,6 @@ public String toString() { sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); sb.append(" resultCountForAll: ").append(toIndentedString(resultCountForAll)).append("\n"); sb.append(" resultCountByNamespace: ").append(toIndentedString(resultCountByNamespace)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -232,22 +190,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayBrowserSidebar - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayBrowserSidebar.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayBrowserSidebar + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayBrowserSidebar.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayBrowserSidebar is not found in the empty JSON string", ArrayBrowserSidebar.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayBrowserSidebar.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayBrowserSidebar` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonNull() && !jsonObj.get("namespaces").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); } } @@ -267,71 +232,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayBrowserSidebar value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayBrowserSidebar read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayBrowserSidebar instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayBrowserSidebar given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayBrowserSidebar - * @throws IOException if the JSON string is invalid with respect to ArrayBrowserSidebar - */ + /** + * Create an instance of ArrayBrowserSidebar given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayBrowserSidebar + * @throws IOException if the JSON string is invalid with respect to ArrayBrowserSidebar + */ public static ArrayBrowserSidebar fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayBrowserSidebar.class); } - /** - * Convert an instance of ArrayBrowserSidebar to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayBrowserSidebar 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/model/ArrayConsolidationRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequest.java index 719ef85..7325882 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequest.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TileDBConfig; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +52,7 @@ /** * Request to consolidate an array */ -@ApiModel(description = "Request to consolidate an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayConsolidationRequest { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -52,36 +60,31 @@ public class ArrayConsolidationRequest { public static final String SERIALIZED_NAME_FRAGMENTS = "fragments"; @SerializedName(SERIALIZED_NAME_FRAGMENTS) - private List fragments = null; + private List fragments = new ArrayList<>(); - public ArrayConsolidationRequest() { + public ArrayConsolidationRequest() { } public ArrayConsolidationRequest config(TileDBConfig config) { - this.config = config; return this; } - /** + /** * Get config * @return config - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TileDBConfig getConfig() { return config; } - public void setConfig(TileDBConfig config) { this.config = config; } public ArrayConsolidationRequest fragments(List fragments) { - this.fragments = fragments; return this; } @@ -94,57 +97,19 @@ public ArrayConsolidationRequest addFragmentsItem(String fragmentsItem) { return this; } - /** + /** * list of fragments in the array to consolidate * @return fragments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of fragments in the array to consolidate") - public List getFragments() { return fragments; } - public void setFragments(List fragments) { this.fragments = fragments; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayConsolidationRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +122,12 @@ public boolean equals(Object o) { } ArrayConsolidationRequest arrayConsolidationRequest = (ArrayConsolidationRequest) o; return Objects.equals(this.config, arrayConsolidationRequest.config) && - Objects.equals(this.fragments, arrayConsolidationRequest.fragments)&& - Objects.equals(this.additionalProperties, arrayConsolidationRequest.additionalProperties); + Objects.equals(this.fragments, arrayConsolidationRequest.fragments); } @Override public int hashCode() { - return Objects.hash(config, fragments, additionalProperties); + return Objects.hash(config, fragments); } @Override @@ -172,7 +136,6 @@ public String toString() { sb.append("class ArrayConsolidationRequest {\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); sb.append(" fragments: ").append(toIndentedString(fragments)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,26 +165,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayConsolidationRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayConsolidationRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayConsolidationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayConsolidationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayConsolidationRequest is not found in the empty JSON string", ArrayConsolidationRequest.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayConsolidationRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayConsolidationRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `config` - if (jsonObj.getAsJsonObject("config") != null) { - TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + TileDBConfig.validateJsonElement(jsonObj.get("config")); } - // ensure the json data is an array - if (jsonObj.get("fragments") != null && !jsonObj.get("fragments").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fragments") != null && !jsonObj.get("fragments").isJsonNull() && !jsonObj.get("fragments").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fragments` to be an array in the JSON string but got `%s`", jsonObj.get("fragments").toString())); } } @@ -241,71 +211,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayConsolidationRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayConsolidationRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayConsolidationRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayConsolidationRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayConsolidationRequest - * @throws IOException if the JSON string is invalid with respect to ArrayConsolidationRequest - */ + /** + * Create an instance of ArrayConsolidationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayConsolidationRequest + * @throws IOException if the JSON string is invalid with respect to ArrayConsolidationRequest + */ public static ArrayConsolidationRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayConsolidationRequest.class); } - /** - * Convert an instance of ArrayConsolidationRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayConsolidationRequest 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/model/ArrayEndTimestampData.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampData.java index 46c75a1..1cef671 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampData.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,22 +52,20 @@ /** * Object including array end_timestamps (list of Unix epoch timestamps in milliseconds) and pagination metadata */ -@ApiModel(description = "Object including array end_timestamps (list of Unix epoch timestamps in milliseconds) and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayEndTimestampData { public static final String SERIALIZED_NAME_END_TIMESTAMPS = "end_timestamps"; @SerializedName(SERIALIZED_NAME_END_TIMESTAMPS) - private List endTimestamps = null; + private List endTimestamps = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public ArrayEndTimestampData() { + public ArrayEndTimestampData() { } public ArrayEndTimestampData endTimestamps(List endTimestamps) { - this.endTimestamps = endTimestamps; return this; } @@ -71,80 +78,38 @@ public ArrayEndTimestampData addEndTimestampsItem(Integer endTimestampsItem) { return this; } - /** + /** * List of timestamps expressed in milliseconds since Unix epoch * @return endTimestamps - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of timestamps expressed in milliseconds since Unix epoch") - public List getEndTimestamps() { return endTimestamps; } - public void setEndTimestamps(List endTimestamps) { this.endTimestamps = endTimestamps; } public ArrayEndTimestampData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayEndTimestampData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +122,12 @@ public boolean equals(Object o) { } ArrayEndTimestampData arrayEndTimestampData = (ArrayEndTimestampData) o; return Objects.equals(this.endTimestamps, arrayEndTimestampData.endTimestamps) && - Objects.equals(this.paginationMetadata, arrayEndTimestampData.paginationMetadata)&& - Objects.equals(this.additionalProperties, arrayEndTimestampData.additionalProperties); + Objects.equals(this.paginationMetadata, arrayEndTimestampData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(endTimestamps, paginationMetadata, additionalProperties); + return Objects.hash(endTimestamps, paginationMetadata); } @Override @@ -172,7 +136,6 @@ public String toString() { sb.append("class ArrayEndTimestampData {\n"); sb.append(" endTimestamps: ").append(toIndentedString(endTimestamps)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,27 +165,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayEndTimestampData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayEndTimestampData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayEndTimestampData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayEndTimestampData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayEndTimestampData is not found in the empty JSON string", ArrayEndTimestampData.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("end_timestamps") != null && !jsonObj.get("end_timestamps").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayEndTimestampData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayEndTimestampData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("end_timestamps") != null && !jsonObj.get("end_timestamps").isJsonNull() && !jsonObj.get("end_timestamps").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `end_timestamps` to be an array in the JSON string but got `%s`", jsonObj.get("end_timestamps").toString())); } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -241,71 +211,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayEndTimestampData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayEndTimestampData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayEndTimestampData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayEndTimestampData given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayEndTimestampData - * @throws IOException if the JSON string is invalid with respect to ArrayEndTimestampData - */ + /** + * Create an instance of ArrayEndTimestampData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayEndTimestampData + * @throws IOException if the JSON string is invalid with respect to ArrayEndTimestampData + */ public static ArrayEndTimestampData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayEndTimestampData.class); } - /** - * Convert an instance of ArrayEndTimestampData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayEndTimestampData 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/model/ArrayFavorite.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayFavorite.java index e74d30c..7ee0e2b 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayFavorite.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayFavorite.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * A user-favorite array item */ -@ApiModel(description = "A user-favorite array item") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayFavorite { public static final String SERIALIZED_NAME_ARRAY_UUID = "array_uuid"; @SerializedName(SERIALIZED_NAME_ARRAY_UUID) @@ -56,112 +63,65 @@ public class ArrayFavorite { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public ArrayFavorite() { + public ArrayFavorite() { } public ArrayFavorite arrayUuid(String arrayUuid) { - this.arrayUuid = arrayUuid; return this; } - /** + /** * unique UUID of the array * @return arrayUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "unique UUID of the array") - public String getArrayUuid() { return arrayUuid; } - public void setArrayUuid(String arrayUuid) { this.arrayUuid = arrayUuid; } public ArrayFavorite namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * the namespace of the array * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the namespace of the array") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public ArrayFavorite name(String name) { - this.name = name; return this; } - /** + /** * the name of the array * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the array") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayFavorite putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { ArrayFavorite arrayFavorite = (ArrayFavorite) o; return Objects.equals(this.arrayUuid, arrayFavorite.arrayUuid) && Objects.equals(this.namespace, arrayFavorite.namespace) && - Objects.equals(this.name, arrayFavorite.name)&& - Objects.equals(this.additionalProperties, arrayFavorite.additionalProperties); + Objects.equals(this.name, arrayFavorite.name); } @Override public int hashCode() { - return Objects.hash(arrayUuid, namespace, name, additionalProperties); + return Objects.hash(arrayUuid, namespace, name); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" arrayUuid: ").append(toIndentedString(arrayUuid)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayFavorite - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayFavorite.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayFavorite + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayFavorite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayFavorite is not found in the empty JSON string", ArrayFavorite.openapiRequiredFields.toString())); } } - if (jsonObj.get("array_uuid") != null && !jsonObj.get("array_uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayFavorite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayFavorite` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("array_uuid") != null && !jsonObj.get("array_uuid").isJsonNull()) && !jsonObj.get("array_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_uuid").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayFavorite value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayFavorite read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayFavorite instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayFavorite given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayFavorite - * @throws IOException if the JSON string is invalid with respect to ArrayFavorite - */ + /** + * Create an instance of ArrayFavorite given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayFavorite + * @throws IOException if the JSON string is invalid with respect to ArrayFavorite + */ public static ArrayFavorite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayFavorite.class); } - /** - * Convert an instance of ArrayFavorite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayFavorite 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/model/ArrayFavoritesData.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesData.java index e7345fe..39baff5 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesData.java @@ -14,51 +14,59 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Object including array favorites and pagination metadata */ -@ApiModel(description = "Object including array favorites and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayFavoritesData { public static final String SERIALIZED_NAME_ARRAYS = "arrays"; @SerializedName(SERIALIZED_NAME_ARRAYS) - private List arrays = null; + private List arrays = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public ArrayFavoritesData() { + public ArrayFavoritesData() { } public ArrayFavoritesData arrays(List arrays) { - this.arrays = arrays; return this; } @@ -71,80 +79,38 @@ public ArrayFavoritesData addArraysItem(ArrayInfo arraysItem) { return this; } - /** + /** * List of array infos * @return arrays - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of array infos") - public List getArrays() { return arrays; } - public void setArrays(List arrays) { this.arrays = arrays; } public ArrayFavoritesData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayFavoritesData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +123,12 @@ public boolean equals(Object o) { } ArrayFavoritesData arrayFavoritesData = (ArrayFavoritesData) o; return Objects.equals(this.arrays, arrayFavoritesData.arrays) && - Objects.equals(this.paginationMetadata, arrayFavoritesData.paginationMetadata)&& - Objects.equals(this.additionalProperties, arrayFavoritesData.additionalProperties); + Objects.equals(this.paginationMetadata, arrayFavoritesData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(arrays, paginationMetadata, additionalProperties); + return Objects.hash(arrays, paginationMetadata); } @Override @@ -172,7 +137,6 @@ public String toString() { sb.append("class ArrayFavoritesData {\n"); sb.append(" arrays: ").append(toIndentedString(arrays)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayFavoritesData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayFavoritesData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayFavoritesData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayFavoritesData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayFavoritesData is not found in the empty JSON string", ArrayFavoritesData.openapiRequiredFields.toString())); } } - JsonArray jsonArrayarrays = jsonObj.getAsJsonArray("arrays"); - if (jsonArrayarrays != null) { - // ensure the json data is an array - if (!jsonObj.get("arrays").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `arrays` to be an array in the JSON string but got `%s`", jsonObj.get("arrays").toString())); - } - // validate the optional field `arrays` (array) - for (int i = 0; i < jsonArrayarrays.size(); i++) { - ArrayInfo.validateJsonObject(jsonArrayarrays.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayFavoritesData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayFavoritesData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("arrays") != null && !jsonObj.get("arrays").isJsonNull()) { + JsonArray jsonArrayarrays = jsonObj.getAsJsonArray("arrays"); + if (jsonArrayarrays != null) { + // ensure the json data is an array + if (!jsonObj.get("arrays").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrays` to be an array in the JSON string but got `%s`", jsonObj.get("arrays").toString())); + } + + // validate the optional field `arrays` (array) + for (int i = 0; i < jsonArrayarrays.size(); i++) { + ArrayInfo.validateJsonElement(jsonArrayarrays.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -249,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayFavoritesData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayFavoritesData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayFavoritesData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayFavoritesData given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayFavoritesData - * @throws IOException if the JSON string is invalid with respect to ArrayFavoritesData - */ + /** + * Create an instance of ArrayFavoritesData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayFavoritesData + * @throws IOException if the JSON string is invalid with respect to ArrayFavoritesData + */ public static ArrayFavoritesData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayFavoritesData.class); } - /** - * Convert an instance of ArrayFavoritesData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayFavoritesData 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/model/ArrayInfo.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayInfo.java index 86bef8f..a8f779c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayInfo.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayInfo.java @@ -14,33 +14,47 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.ArrayType; +import io.tiledb.cloud.rest_api.model.FileType; +import io.tiledb.cloud.rest_api.model.MetadataStringifiedEntry; +import io.tiledb.cloud.rest_api.model.Pricing; +import io.tiledb.cloud.rest_api.model.Subscription; import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; +import java.util.HashMap; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.List; +import java.util.Map; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -48,8 +62,7 @@ /** * metadata of an array */ -@ApiModel(description = "metadata of an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayInfo { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -65,7 +78,7 @@ public class ArrayInfo { public static final String SERIALIZED_NAME_FILE_PROPERTIES = "file_properties"; @SerializedName(SERIALIZED_NAME_FILE_PROPERTIES) - private Map fileProperties = null; + private Map fileProperties = new HashMap<>(); public static final String SERIALIZED_NAME_URI = "uri"; @SerializedName(SERIALIZED_NAME_URI) @@ -93,15 +106,15 @@ public class ArrayInfo { public static final String SERIALIZED_NAME_ALLOWED_ACTIONS = "allowed_actions"; @SerializedName(SERIALIZED_NAME_ALLOWED_ACTIONS) - private List allowedActions = null; + private List allowedActions = new ArrayList<>(); public static final String SERIALIZED_NAME_PRICING = "pricing"; @SerializedName(SERIALIZED_NAME_PRICING) - private List pricing = null; + private List pricing = new ArrayList<>(); public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions"; @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS) - private List subscriptions = null; + private List subscriptions = new ArrayList<>(); public static final String SERIALIZED_NAME_LOGO = "logo"; @SerializedName(SERIALIZED_NAME_LOGO) @@ -133,7 +146,7 @@ public class ArrayInfo { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; @SerializedName(SERIALIZED_NAME_LICENSE_ID) @@ -161,12 +174,11 @@ public class ArrayInfo { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private List metadata = null; + private List metadata = new ArrayList<>(); - public ArrayInfo() { + public ArrayInfo() { } - public ArrayInfo( Boolean namespaceSubscribed ) { @@ -175,76 +187,63 @@ public ArrayInfo( } public ArrayInfo id(String id) { - this.id = id; return this; } - /** + /** * unique ID of registered array * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of registered array") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public ArrayInfo assetId(String assetId) { - this.assetId = assetId; return this; } - /** + /** * The asset id of the created array * @return assetId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The asset id of the created array") - public String getAssetId() { return assetId; } - public void setAssetId(String assetId) { this.assetId = assetId; } public ArrayInfo fileType(FileType fileType) { - this.fileType = fileType; return this; } - /** + /** * Get fileType * @return fileType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public FileType getFileType() { return fileType; } - public void setFileType(FileType fileType) { this.fileType = fileType; } public ArrayInfo fileProperties(Map fileProperties) { - this.fileProperties = fileProperties; return this; } @@ -257,163 +256,135 @@ public ArrayInfo putFilePropertiesItem(String key, String filePropertiesItem) { return this; } - /** + /** * map of file properties created for this array * @return fileProperties - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "map of file properties created for this array") - public Map getFileProperties() { return fileProperties; } - public void setFileProperties(Map fileProperties) { this.fileProperties = fileProperties; } public ArrayInfo uri(String uri) { - this.uri = uri; return this; } - /** + /** * uri of array * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "s3://bucket/array", value = "uri of array") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public ArrayInfo namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace array is in * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "user1", value = "namespace array is in") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public ArrayInfo size(BigDecimal size) { - this.size = size; return this; } - /** + /** * size in bytes of array * @return size - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1024.0", value = "size in bytes of array") - public BigDecimal getSize() { return size; } - public void setSize(BigDecimal size) { this.size = size; } public ArrayInfo lastAccessed(OffsetDateTime lastAccessed) { - this.lastAccessed = lastAccessed; return this; } - /** + /** * Datetime array was last accessed in UTC * @return lastAccessed - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime array was last accessed in UTC") - public OffsetDateTime getLastAccessed() { return lastAccessed; } - public void setLastAccessed(OffsetDateTime lastAccessed) { this.lastAccessed = lastAccessed; } public ArrayInfo description(String description) { - this.description = description; return this; } - /** + /** * description of array * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "description of array") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public ArrayInfo name(String name) { - this.name = name; return this; } - /** + /** * name of array * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "myarray1", value = "name of array") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public ArrayInfo allowedActions(List allowedActions) { - this.allowedActions = allowedActions; return this; } @@ -426,25 +397,21 @@ public ArrayInfo addAllowedActionsItem(ArrayActions allowedActionsItem) { return this; } - /** + /** * list of actions user is allowed to do on this array * @return allowedActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of actions user is allowed to do on this array") - public List getAllowedActions() { return allowedActions; } - public void setAllowedActions(List allowedActions) { this.allowedActions = allowedActions; } public ArrayInfo pricing(List pricing) { - this.pricing = pricing; return this; } @@ -457,25 +424,21 @@ public ArrayInfo addPricingItem(Pricing pricingItem) { return this; } - /** + /** * list of pricing created for this array * @return pricing - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of pricing created for this array") - public List getPricing() { return pricing; } - public void setPricing(List pricing) { this.pricing = pricing; } public ArrayInfo subscriptions(List subscriptions) { - this.subscriptions = subscriptions; return this; } @@ -488,177 +451,146 @@ public ArrayInfo addSubscriptionsItem(Subscription subscriptionsItem) { return this; } - /** + /** * list of subscriptions created for this array * @return subscriptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of subscriptions created for this array") - public List getSubscriptions() { return subscriptions; } - public void setSubscriptions(List subscriptions) { this.subscriptions = subscriptions; } public ArrayInfo logo(String logo) { - this.logo = logo; return this; } - /** + /** * logo (base64 encoded) for the array. Optional * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logo (base64 encoded) for the array. Optional") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public ArrayInfo accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * the name of the access credentials to use. if unset, the default credentials will be used * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public ArrayInfo type(ArrayType type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayType getType() { return type; } - public void setType(ArrayType type) { this.type = type; } public ArrayInfo shareCount(BigDecimal shareCount) { - this.shareCount = shareCount; return this; } - /** + /** * number of unique namespaces this array is shared with * @return shareCount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "number of unique namespaces this array is shared with") - public BigDecimal getShareCount() { return shareCount; } - public void setShareCount(BigDecimal shareCount) { this.shareCount = shareCount; } public ArrayInfo publicShare(Boolean publicShare) { - this.publicShare = publicShare; return this; } - /** + /** * Suggests if the array was shared to public by owner * @return publicShare - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Suggests if the array was shared to public by owner") - public Boolean getPublicShare() { return publicShare; } - public void setPublicShare(Boolean publicShare) { this.publicShare = publicShare; } - /** + /** * Depends on the namespace asking, denotes the existence of subscription of namespace to this array * @return namespaceSubscribed - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "Depends on the namespace asking, denotes the existence of subscription of namespace to this array") - public Boolean getNamespaceSubscribed() { return namespaceSubscribed; } - public ArrayInfo tiledbUri(String tiledbUri) { - this.tiledbUri = tiledbUri; return this; } - /** + /** * uri for access through TileDB cloud * @return tiledbUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "uri for access through TileDB cloud") - public String getTiledbUri() { return tiledbUri; } - public void setTiledbUri(String tiledbUri) { this.tiledbUri = tiledbUri; } public ArrayInfo tags(List tags) { - this.tags = tags; return this; } @@ -671,163 +603,135 @@ public ArrayInfo addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for array * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for array") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public ArrayInfo licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public ArrayInfo licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } public ArrayInfo readOnly(Boolean readOnly) { - this.readOnly = readOnly; return this; } - /** + /** * Suggests if the array is in read_only mode * @return readOnly - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "Suggests if the array is in read_only mode") - public Boolean getReadOnly() { return readOnly; } - public void setReadOnly(Boolean readOnly) { this.readOnly = readOnly; } public ArrayInfo isFavorite(Boolean isFavorite) { - this.isFavorite = isFavorite; return this; } - /** + /** * Indicates whether the array is in user favorites * @return isFavorite - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Indicates whether the array is in user favorites") - public Boolean getIsFavorite() { return isFavorite; } - public void setIsFavorite(Boolean isFavorite) { this.isFavorite = isFavorite; } public ArrayInfo createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } - /** + /** * Datetime array was registered with tiledb * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime array was registered with tiledb") - public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } public ArrayInfo createdBy(String createdBy) { - this.createdBy = createdBy; return this; } - /** + /** * The user who created the array, if known. * @return createdBy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The user who created the array, if known.") - public String getCreatedBy() { return createdBy; } - public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public ArrayInfo metadata(List metadata) { - this.metadata = metadata; return this; } @@ -840,57 +744,19 @@ public ArrayInfo addMetadataItem(MetadataStringifiedEntry metadataItem) { return this; } - /** + /** * Contains the metadata of the array. **Note:** This property is included in the response only if the `with_metadata` query parameter is set to `true`. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Contains the metadata of the array. **Note:** This property is included in the response only if the `with_metadata` query parameter is set to `true`. ") - public List getMetadata() { return metadata; } - public void setMetadata(List metadata) { this.metadata = metadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayInfo putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -929,8 +795,7 @@ public boolean equals(Object o) { Objects.equals(this.isFavorite, arrayInfo.isFavorite) && Objects.equals(this.createdAt, arrayInfo.createdAt) && Objects.equals(this.createdBy, arrayInfo.createdBy) && - Objects.equals(this.metadata, arrayInfo.metadata)&& - Objects.equals(this.additionalProperties, arrayInfo.additionalProperties); + Objects.equals(this.metadata, arrayInfo.metadata); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -939,7 +804,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, assetId, fileType, fileProperties, uri, namespace, size, lastAccessed, description, name, allowedActions, pricing, subscriptions, logo, accessCredentialsName, type, shareCount, publicShare, namespaceSubscribed, tiledbUri, tags, licenseId, licenseText, readOnly, isFavorite, createdAt, createdBy, metadata, additionalProperties); + return Objects.hash(id, assetId, fileType, fileProperties, uri, namespace, size, lastAccessed, description, name, allowedActions, pricing, subscriptions, logo, accessCredentialsName, type, shareCount, publicShare, namespaceSubscribed, tiledbUri, tags, licenseId, licenseText, readOnly, isFavorite, createdAt, createdBy, metadata); } private static int hashCodeNullable(JsonNullable a) { @@ -981,7 +846,6 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1037,99 +901,120 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + 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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("asset_id") != null && !jsonObj.get("asset_id").isJsonPrimitive()) { + if ((jsonObj.get("asset_id") != null && !jsonObj.get("asset_id").isJsonNull()) && !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("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + // validate the optional field `file_type` + if (jsonObj.get("file_type") != null && !jsonObj.get("file_type").isJsonNull()) { + FileType.validateJsonElement(jsonObj.get("file_type")); + } + 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("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + 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("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } - // ensure the json data is an array - if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonNull() && !jsonObj.get("allowed_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `allowed_actions` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_actions").toString())); } - JsonArray jsonArraypricing = jsonObj.getAsJsonArray("pricing"); - if (jsonArraypricing != null) { - // ensure the json data is an array - if (!jsonObj.get("pricing").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `pricing` to be an array in the JSON string but got `%s`", jsonObj.get("pricing").toString())); + if (jsonObj.get("pricing") != null && !jsonObj.get("pricing").isJsonNull()) { + JsonArray jsonArraypricing = jsonObj.getAsJsonArray("pricing"); + if (jsonArraypricing != null) { + // ensure the json data is an array + if (!jsonObj.get("pricing").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pricing` to be an array in the JSON string but got `%s`", jsonObj.get("pricing").toString())); + } + + // validate the optional field `pricing` (array) + for (int i = 0; i < jsonArraypricing.size(); i++) { + Pricing.validateJsonElement(jsonArraypricing.get(i)); + }; } - - // validate the optional field `pricing` (array) - for (int i = 0; i < jsonArraypricing.size(); i++) { - Pricing.validateJsonObject(jsonArraypricing.get(i).getAsJsonObject()); - }; } - JsonArray jsonArraysubscriptions = jsonObj.getAsJsonArray("subscriptions"); - if (jsonArraysubscriptions != null) { - // ensure the json data is an array - if (!jsonObj.get("subscriptions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subscriptions` to be an array in the JSON string but got `%s`", jsonObj.get("subscriptions").toString())); + if (jsonObj.get("subscriptions") != null && !jsonObj.get("subscriptions").isJsonNull()) { + JsonArray jsonArraysubscriptions = jsonObj.getAsJsonArray("subscriptions"); + if (jsonArraysubscriptions != null) { + // ensure the json data is an array + if (!jsonObj.get("subscriptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscriptions` to be an array in the JSON string but got `%s`", jsonObj.get("subscriptions").toString())); + } + + // validate the optional field `subscriptions` (array) + for (int i = 0; i < jsonArraysubscriptions.size(); i++) { + Subscription.validateJsonElement(jsonArraysubscriptions.get(i)); + }; } - - // validate the optional field `subscriptions` (array) - for (int i = 0; i < jsonArraysubscriptions.size(); i++) { - Subscription.validateJsonObject(jsonArraysubscriptions.get(i).getAsJsonObject()); - }; } - if (jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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("tiledb_uri") != null && !jsonObj.get("tiledb_uri").isJsonPrimitive()) { + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + ArrayType.validateJsonElement(jsonObj.get("type")); + } + if ((jsonObj.get("tiledb_uri") != null && !jsonObj.get("tiledb_uri").isJsonNull()) && !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())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } - if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonPrimitive()) { + if ((jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) && !jsonObj.get("created_by").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `created_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_by").toString())); } - 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())); + 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++) { + MetadataStringifiedEntry.validateJsonElement(jsonArraymetadata.get(i)); + }; } - - // validate the optional field `metadata` (array) - for (int i = 0; i < jsonArraymetadata.size(); i++) { - MetadataStringifiedEntry.validateJsonObject(jsonArraymetadata.get(i).getAsJsonObject()); - }; } } @@ -1148,71 +1033,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/ArrayInfoUpdate.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdate.java index 20a6a45..64e9878 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdate.java @@ -14,30 +14,40 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.FileType; 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 org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; +import java.util.HashMap; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.List; +import java.util.Map; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -45,8 +55,7 @@ /** * metadata of an array */ -@ApiModel(description = "metadata of an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayInfoUpdate { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -66,7 +75,7 @@ public class ArrayInfoUpdate { public static final String SERIALIZED_NAME_FILE_PROPERTIES = "file_properties"; @SerializedName(SERIALIZED_NAME_FILE_PROPERTIES) - private Map fileProperties = null; + private Map fileProperties = new HashMap<>(); public static final String SERIALIZED_NAME_ACCESS_CREDENTIALS_NAME = "access_credentials_name"; @SerializedName(SERIALIZED_NAME_ACCESS_CREDENTIALS_NAME) @@ -78,7 +87,7 @@ public class ArrayInfoUpdate { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; @SerializedName(SERIALIZED_NAME_LICENSE_ID) @@ -92,103 +101,86 @@ public class ArrayInfoUpdate { @SerializedName(SERIALIZED_NAME_READ_ONLY) private Boolean readOnly; - public ArrayInfoUpdate() { + public ArrayInfoUpdate() { } public ArrayInfoUpdate description(String description) { - this.description = description; return this; } - /** + /** * description of array * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "description of array") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public ArrayInfoUpdate name(String name) { - this.name = name; return this; } - /** + /** * description of array * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "myarray1", value = "description of array") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public ArrayInfoUpdate uri(String uri) { - this.uri = uri; return this; } - /** + /** * uri of array * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "s3://bucket/array", value = "uri of array") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public ArrayInfoUpdate fileType(FileType fileType) { - this.fileType = fileType; return this; } - /** + /** * Get fileType * @return fileType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public FileType getFileType() { return fileType; } - public void setFileType(FileType fileType) { this.fileType = fileType; } public ArrayInfoUpdate fileProperties(Map fileProperties) { - this.fileProperties = fileProperties; return this; } @@ -201,71 +193,59 @@ public ArrayInfoUpdate putFilePropertiesItem(String key, String filePropertiesIt return this; } - /** + /** * map of file properties created for this array * @return fileProperties - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "map of file properties created for this array") - public Map getFileProperties() { return fileProperties; } - public void setFileProperties(Map fileProperties) { this.fileProperties = fileProperties; } public ArrayInfoUpdate accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * the name of the access credentials to use. if unset, the default credentials will be used * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public ArrayInfoUpdate logo(String logo) { - this.logo = logo; return this; } - /** + /** * logo (base64 encoded) for the array. Optional * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logo (base64 encoded) for the array. Optional") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public ArrayInfoUpdate tags(List tags) { - this.tags = tags; return this; } @@ -278,126 +258,76 @@ public ArrayInfoUpdate addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for array * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for array") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public ArrayInfoUpdate licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public ArrayInfoUpdate licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } public ArrayInfoUpdate readOnly(Boolean readOnly) { - this.readOnly = readOnly; return this; } - /** + /** * Suggests if the array is in read_only mode * @return readOnly - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Suggests if the array is in read_only mode") - public Boolean getReadOnly() { return readOnly; } - public void setReadOnly(Boolean readOnly) { this.readOnly = readOnly; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayInfoUpdate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -419,8 +349,7 @@ public boolean equals(Object o) { Objects.equals(this.tags, arrayInfoUpdate.tags) && Objects.equals(this.licenseId, arrayInfoUpdate.licenseId) && Objects.equals(this.licenseText, arrayInfoUpdate.licenseText) && - Objects.equals(this.readOnly, arrayInfoUpdate.readOnly)&& - Objects.equals(this.additionalProperties, arrayInfoUpdate.additionalProperties); + Objects.equals(this.readOnly, arrayInfoUpdate.readOnly); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -429,7 +358,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(description, name, uri, fileType, fileProperties, accessCredentialsName, logo, tags, licenseId, licenseText, readOnly, additionalProperties); + return Objects.hash(description, name, uri, fileType, fileProperties, accessCredentialsName, logo, tags, licenseId, licenseText, readOnly); } private static int hashCodeNullable(JsonNullable a) { @@ -454,7 +383,6 @@ public String toString() { sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); sb.append(" readOnly: ").append(toIndentedString(readOnly)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -493,43 +421,54 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayInfoUpdate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayInfoUpdate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayInfoUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayInfoUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayInfoUpdate is not found in the empty JSON string", ArrayInfoUpdate.openapiRequiredFields.toString())); } } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayInfoUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayInfoUpdate` 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + 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("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + // validate the optional field `file_type` + if (jsonObj.get("file_type") != null && !jsonObj.get("file_type").isJsonNull()) { + FileType.validateJsonElement(jsonObj.get("file_type")); + } + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } } @@ -549,71 +488,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayInfoUpdate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayInfoUpdate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayInfoUpdate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayInfoUpdate given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayInfoUpdate - * @throws IOException if the JSON string is invalid with respect to ArrayInfoUpdate - */ + /** + * Create an instance of ArrayInfoUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayInfoUpdate + * @throws IOException if the JSON string is invalid with respect to ArrayInfoUpdate + */ public static ArrayInfoUpdate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayInfoUpdate.class); } - /** - * Convert an instance of ArrayInfoUpdate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayInfoUpdate 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/model/ArrayMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayMetadata.java index 04df947..74cc434 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayMetadata.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayMetadata.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayMetadataEntry; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,18 +52,16 @@ /** * user's TileDB array metadata */ -@ApiModel(description = "user's TileDB array metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayMetadata { public static final String SERIALIZED_NAME_ENTRIES = "entries"; @SerializedName(SERIALIZED_NAME_ENTRIES) - private List entries = null; + private List entries = new ArrayList<>(); - public ArrayMetadata() { + public ArrayMetadata() { } public ArrayMetadata entries(List entries) { - this.entries = entries; return this; } @@ -68,57 +74,19 @@ public ArrayMetadata addEntriesItem(ArrayMetadataEntry entriesItem) { return this; } - /** + /** * List of metadata entries * @return entries - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of metadata entries") - public List getEntries() { return entries; } - public void setEntries(List entries) { this.entries = entries; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayMetadata putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -130,13 +98,12 @@ public boolean equals(Object o) { return false; } ArrayMetadata arrayMetadata = (ArrayMetadata) o; - return Objects.equals(this.entries, arrayMetadata.entries)&& - Objects.equals(this.additionalProperties, arrayMetadata.additionalProperties); + return Objects.equals(this.entries, arrayMetadata.entries); } @Override public int hashCode() { - return Objects.hash(entries, additionalProperties); + return Objects.hash(entries); } @Override @@ -144,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ArrayMetadata {\n"); sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -173,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayMetadata.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayMetadata is not found in the empty JSON string", ArrayMetadata.openapiRequiredFields.toString())); } } - JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); - if (jsonArrayentries != null) { - // ensure the json data is an array - 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())); - } - // validate the optional field `entries` (array) - for (int i = 0; i < jsonArrayentries.size(); i++) { - ArrayMetadataEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + ArrayMetadataEntry.validateJsonElement(jsonArrayentries.get(i)); + }; + } } } @@ -216,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayMetadata value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayMetadata instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayMetadata - * @throws IOException if the JSON string is invalid with respect to ArrayMetadata - */ + /** + * Create an instance of ArrayMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayMetadata + * @throws IOException if the JSON string is invalid with respect to ArrayMetadata + */ public static ArrayMetadata fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayMetadata.class); } - /** - * Convert an instance of ArrayMetadata to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayMetadata 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/model/ArrayMetadataEntry.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntry.java index 8363c2e..9bb909d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntry.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntry.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * key/value pair representing an array metadata map entry */ -@ApiModel(description = "key/value pair representing an array metadata map entry") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayMetadataEntry { public static final String SERIALIZED_NAME_KEY = "key"; @SerializedName(SERIALIZED_NAME_KEY) @@ -60,86 +67,73 @@ public class ArrayMetadataEntry { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private List value = null; + private List value = new ArrayList<>(); public static final String SERIALIZED_NAME_DEL = "del"; @SerializedName(SERIALIZED_NAME_DEL) private Boolean del; - public ArrayMetadataEntry() { + public ArrayMetadataEntry() { } public ArrayMetadataEntry key(String key) { - this.key = key; return this; } - /** + /** * Get key * @return key - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getKey() { return key; } - public void setKey(String key) { this.key = key; } public ArrayMetadataEntry type(String type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getType() { return type; } - public void setType(String type) { this.type = type; } public ArrayMetadataEntry valueNum(Integer valueNum) { - this.valueNum = valueNum; return this; } - /** + /** * Get valueNum * @return valueNum - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getValueNum() { return valueNum; } - public void setValueNum(Integer valueNum) { this.valueNum = valueNum; } public ArrayMetadataEntry value(List value) { - this.value = value; return this; } @@ -152,80 +146,38 @@ public ArrayMetadataEntry addValueItem(Integer valueItem) { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getValue() { return value; } - public void setValue(List value) { this.value = value; } public ArrayMetadataEntry del(Boolean del) { - this.del = del; return this; } - /** + /** * Get del * @return del - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getDel() { return del; } - public void setDel(Boolean del) { this.del = del; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayMetadataEntry putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -241,13 +193,12 @@ public boolean equals(Object o) { Objects.equals(this.type, arrayMetadataEntry.type) && Objects.equals(this.valueNum, arrayMetadataEntry.valueNum) && Objects.equals(this.value, arrayMetadataEntry.value) && - Objects.equals(this.del, arrayMetadataEntry.del)&& - Objects.equals(this.additionalProperties, arrayMetadataEntry.additionalProperties); + Objects.equals(this.del, arrayMetadataEntry.del); } @Override public int hashCode() { - return Objects.hash(key, type, valueNum, value, del, additionalProperties); + return Objects.hash(key, type, valueNum, value, del); } @Override @@ -259,7 +210,6 @@ public String toString() { sb.append(" valueNum: ").append(toIndentedString(valueNum)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" del: ").append(toIndentedString(del)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -292,28 +242,35 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayMetadataEntry - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayMetadataEntry.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayMetadataEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayMetadataEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayMetadataEntry is not found in the empty JSON string", ArrayMetadataEntry.openapiRequiredFields.toString())); } } - if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayMetadataEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayMetadataEntry` 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("type") != null && !jsonObj.get("type").isJsonPrimitive()) { + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !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("value") != null && !jsonObj.get("value").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull() && !jsonObj.get("value").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } @@ -333,71 +290,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayMetadataEntry value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayMetadataEntry read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayMetadataEntry instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayMetadataEntry given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayMetadataEntry - * @throws IOException if the JSON string is invalid with respect to ArrayMetadataEntry - */ + /** + * Create an instance of ArrayMetadataEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayMetadataEntry + * @throws IOException if the JSON string is invalid with respect to ArrayMetadataEntry + */ public static ArrayMetadataEntry fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayMetadataEntry.class); } - /** - * Convert an instance of ArrayMetadataEntry to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayMetadataEntry 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/model/ArraySample.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArraySample.java index 43c393a..30ec798 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArraySample.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArraySample.java @@ -14,99 +14,68 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Sample data from array */ -@ApiModel(description = "Sample data from array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArraySample { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) private Object data; - public ArraySample() { + public ArraySample() { } public ArraySample data(Object data) { - this.data = data; return this; } - /** + /** * Get data * @return data - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Object getData() { return data; } - public void setData(Object data) { this.data = data; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArraySample putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -118,13 +87,12 @@ public boolean equals(Object o) { return false; } ArraySample arraySample = (ArraySample) o; - return Objects.equals(this.data, arraySample.data)&& - Objects.equals(this.additionalProperties, arraySample.additionalProperties); + return Objects.equals(this.data, arraySample.data); } @Override public int hashCode() { - return Objects.hash(data, additionalProperties); + return Objects.hash(data); } @Override @@ -132,7 +100,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ArraySample {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -161,20 +128,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArraySample - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArraySample.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArraySample + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArraySample.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArraySample is not found in the empty JSON string", ArraySample.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArraySample.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArraySample` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -192,71 +166,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArraySample value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArraySample read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArraySample instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArraySample given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArraySample - * @throws IOException if the JSON string is invalid with respect to ArraySample - */ + /** + * Create an instance of ArraySample given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArraySample + * @throws IOException if the JSON string is invalid with respect to ArraySample + */ public static ArraySample fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArraySample.class); } - /** - * Convert an instance of ArraySample to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArraySample 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/model/ArraySchema.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArraySchema.java index dcbb7ec..ec3224a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArraySchema.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArraySchema.java @@ -14,29 +14,41 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayType; +import io.tiledb.cloud.rest_api.model.Attribute; +import io.tiledb.cloud.rest_api.model.Domain; +import io.tiledb.cloud.rest_api.model.FilterPipeline; +import io.tiledb.cloud.rest_api.model.Layout; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +56,7 @@ /** * ArraySchema during creation or retrieval */ -@ApiModel(description = "ArraySchema during creation or retrieval") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArraySchema { public static final String SERIALIZED_NAME_URI = "uri"; @SerializedName(SERIALIZED_NAME_URI) @@ -91,306 +102,233 @@ public class ArraySchema { @SerializedName(SERIALIZED_NAME_ALLOWS_DUPLICATES) private Boolean allowsDuplicates; - public ArraySchema() { + public ArraySchema() { } public ArraySchema uri(String uri) { - this.uri = uri; return this; } - /** + /** * URI of schema * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "s3:///test_array", value = "URI of schema") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public ArraySchema version(List version) { - this.version = version; return this; } public ArraySchema addVersionItem(Integer versionItem) { + if (this.version == null) { + this.version = new ArrayList<>(); + } this.version.add(versionItem); return this; } - /** + /** * file format version * @return version - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "[1, 3, 0]", required = true, value = "file format version") - public List getVersion() { return version; } - public void setVersion(List version) { this.version = version; } public ArraySchema arrayType(ArrayType arrayType) { - this.arrayType = arrayType; return this; } - /** + /** * Get arrayType * @return arrayType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public ArrayType getArrayType() { return arrayType; } - public void setArrayType(ArrayType arrayType) { this.arrayType = arrayType; } public ArraySchema tileOrder(Layout tileOrder) { - this.tileOrder = tileOrder; return this; } - /** + /** * Get tileOrder * @return tileOrder - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Layout getTileOrder() { return tileOrder; } - public void setTileOrder(Layout tileOrder) { this.tileOrder = tileOrder; } public ArraySchema cellOrder(Layout cellOrder) { - this.cellOrder = cellOrder; return this; } - /** + /** * Get cellOrder * @return cellOrder - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Layout getCellOrder() { return cellOrder; } - public void setCellOrder(Layout cellOrder) { this.cellOrder = cellOrder; } public ArraySchema capacity(Integer capacity) { - this.capacity = capacity; return this; } - /** + /** * Capacity of array * @return capacity - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "100000", required = true, value = "Capacity of array") - public Integer getCapacity() { return capacity; } - public void setCapacity(Integer capacity) { this.capacity = capacity; } public ArraySchema coordsFilterPipeline(FilterPipeline coordsFilterPipeline) { - this.coordsFilterPipeline = coordsFilterPipeline; return this; } - /** + /** * Get coordsFilterPipeline * @return coordsFilterPipeline - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public FilterPipeline getCoordsFilterPipeline() { return coordsFilterPipeline; } - public void setCoordsFilterPipeline(FilterPipeline coordsFilterPipeline) { this.coordsFilterPipeline = coordsFilterPipeline; } public ArraySchema offsetFilterPipeline(FilterPipeline offsetFilterPipeline) { - this.offsetFilterPipeline = offsetFilterPipeline; return this; } - /** + /** * Get offsetFilterPipeline * @return offsetFilterPipeline - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public FilterPipeline getOffsetFilterPipeline() { return offsetFilterPipeline; } - public void setOffsetFilterPipeline(FilterPipeline offsetFilterPipeline) { this.offsetFilterPipeline = offsetFilterPipeline; } public ArraySchema domain(Domain domain) { - this.domain = domain; return this; } - /** + /** * Get domain * @return domain - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Domain getDomain() { return domain; } - public void setDomain(Domain domain) { this.domain = domain; } public ArraySchema attributes(List attributes) { - this.attributes = attributes; return this; } public ArraySchema addAttributesItem(Attribute attributesItem) { + if (this.attributes == null) { + this.attributes = new ArrayList<>(); + } this.attributes.add(attributesItem); return this; } - /** + /** * Attributes of array * @return attributes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Attributes of array") - public List getAttributes() { return attributes; } - public void setAttributes(List attributes) { this.attributes = attributes; } public ArraySchema allowsDuplicates(Boolean allowsDuplicates) { - this.allowsDuplicates = allowsDuplicates; return this; } - /** + /** * True if the array allows coordinate duplicates. Applicable only to sparse arrays. * @return allowsDuplicates - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if the array allows coordinate duplicates. Applicable only to sparse arrays.") - public Boolean getAllowsDuplicates() { return allowsDuplicates; } - public void setAllowsDuplicates(Boolean allowsDuplicates) { this.allowsDuplicates = allowsDuplicates; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArraySchema putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -412,13 +350,12 @@ public boolean equals(Object o) { Objects.equals(this.offsetFilterPipeline, arraySchema.offsetFilterPipeline) && Objects.equals(this.domain, arraySchema.domain) && Objects.equals(this.attributes, arraySchema.attributes) && - Objects.equals(this.allowsDuplicates, arraySchema.allowsDuplicates)&& - Objects.equals(this.additionalProperties, arraySchema.additionalProperties); + Objects.equals(this.allowsDuplicates, arraySchema.allowsDuplicates); } @Override public int hashCode() { - return Objects.hash(uri, version, arrayType, tileOrder, cellOrder, capacity, coordsFilterPipeline, offsetFilterPipeline, domain, attributes, allowsDuplicates, additionalProperties); + return Objects.hash(uri, version, arrayType, tileOrder, cellOrder, capacity, coordsFilterPipeline, offsetFilterPipeline, domain, attributes, allowsDuplicates); } @Override @@ -436,7 +373,6 @@ public String toString() { sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" allowsDuplicates: ").append(toIndentedString(allowsDuplicates)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -484,58 +420,65 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("attributes"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArraySchema - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArraySchema.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArraySchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArraySchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArraySchema is not found in the empty JSON string", ArraySchema.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArraySchema.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArraySchema` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ArraySchema.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - // ensure the json data is an array - if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("version") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("version").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `version` to be an array in the JSON string but got `%s`", jsonObj.get("version").toString())); } - // validate the optional field `coordsFilterPipeline` - if (jsonObj.getAsJsonObject("coordsFilterPipeline") != null) { - FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("coordsFilterPipeline")); - } - // validate the optional field `offsetFilterPipeline` - if (jsonObj.getAsJsonObject("offsetFilterPipeline") != null) { - FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("offsetFilterPipeline")); - } - // validate the optional field `domain` - if (jsonObj.getAsJsonObject("domain") != null) { - Domain.validateJsonObject(jsonObj.getAsJsonObject("domain")); + // validate the required field `arrayType` + ArrayType.validateJsonElement(jsonObj.get("arrayType")); + // validate the required field `tileOrder` + Layout.validateJsonElement(jsonObj.get("tileOrder")); + // validate the required field `cellOrder` + Layout.validateJsonElement(jsonObj.get("cellOrder")); + // validate the required field `coordsFilterPipeline` + FilterPipeline.validateJsonElement(jsonObj.get("coordsFilterPipeline")); + // validate the required field `offsetFilterPipeline` + FilterPipeline.validateJsonElement(jsonObj.get("offsetFilterPipeline")); + // validate the required field `domain` + Domain.validateJsonElement(jsonObj.get("domain")); + // ensure the json data is an array + if (!jsonObj.get("attributes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `attributes` to be an array in the JSON string but got `%s`", jsonObj.get("attributes").toString())); } - JsonArray jsonArrayattributes = jsonObj.getAsJsonArray("attributes"); - if (jsonArrayattributes != null) { - // ensure the json data is an array - if (!jsonObj.get("attributes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `attributes` to be an array in the JSON string but got `%s`", jsonObj.get("attributes").toString())); - } - // validate the optional field `attributes` (array) - for (int i = 0; i < jsonArrayattributes.size(); i++) { - Attribute.validateJsonObject(jsonArrayattributes.get(i).getAsJsonObject()); - }; - } + JsonArray jsonArrayattributes = jsonObj.getAsJsonArray("attributes"); + // validate the required field `attributes` (array) + for (int i = 0; i < jsonArrayattributes.size(); i++) { + Attribute.validateJsonElement(jsonArrayattributes.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -553,71 +496,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArraySchema value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArraySchema read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArraySchema instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArraySchema given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArraySchema - * @throws IOException if the JSON string is invalid with respect to ArraySchema - */ + /** + * Create an instance of ArraySchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArraySchema + * @throws IOException if the JSON string is invalid with respect to ArraySchema + */ public static ArraySchema fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArraySchema.class); } - /** - * Convert an instance of ArraySchema to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArraySchema 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/model/ArraySharing.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArraySharing.java index 0ce60d3..cc4e2a3 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArraySharing.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArraySharing.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,12 +52,11 @@ /** * details for sharing a given array */ -@ApiModel(description = "details for sharing a given array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArraySharing { public static final String SERIALIZED_NAME_ACTIONS = "actions"; @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = null; + private List actions = new ArrayList<>(); public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -58,11 +66,10 @@ public class ArraySharing { @SerializedName(SERIALIZED_NAME_NAMESPACE_TYPE) private String namespaceType; - public ArraySharing() { + public ArraySharing() { } public ArraySharing actions(List actions) { - this.actions = actions; return this; } @@ -75,103 +82,57 @@ public ArraySharing addActionsItem(ArrayActions actionsItem) { return this; } - /** + /** * List of permitted actions * @return actions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[read, write]", value = "List of permitted actions") - public List getActions() { return actions; } - public void setActions(List actions) { this.actions = actions; } public ArraySharing namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace being granted array access can be a user or organization * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "MyOrganization", value = "namespace being granted array access can be a user or organization") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public ArraySharing namespaceType(String namespaceType) { - this.namespaceType = namespaceType; return this; } - /** + /** * details on if the namespace is a organization or user * @return namespaceType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "organization", value = "details on if the namespace is a organization or user") - public String getNamespaceType() { return namespaceType; } - public void setNamespaceType(String namespaceType) { this.namespaceType = namespaceType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArraySharing putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -185,13 +146,12 @@ public boolean equals(Object o) { ArraySharing arraySharing = (ArraySharing) o; return Objects.equals(this.actions, arraySharing.actions) && Objects.equals(this.namespace, arraySharing.namespace) && - Objects.equals(this.namespaceType, arraySharing.namespaceType)&& - Objects.equals(this.additionalProperties, arraySharing.additionalProperties); + Objects.equals(this.namespaceType, arraySharing.namespaceType); } @Override public int hashCode() { - return Objects.hash(actions, namespace, namespaceType, additionalProperties); + return Objects.hash(actions, namespace, namespaceType); } @Override @@ -201,7 +161,6 @@ public String toString() { sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" namespaceType: ").append(toIndentedString(namespaceType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -232,28 +191,35 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArraySharing - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArraySharing.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArraySharing + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArraySharing.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArraySharing is not found in the empty JSON string", ArraySharing.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArraySharing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArraySharing` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonNull() && !jsonObj.get("actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonPrimitive()) { + if ((jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonNull()) && !jsonObj.get("namespace_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_type").toString())); } } @@ -273,71 +239,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArraySharing value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArraySharing read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArraySharing instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArraySharing given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArraySharing - * @throws IOException if the JSON string is invalid with respect to ArraySharing - */ + /** + * Create an instance of ArraySharing given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArraySharing + * @throws IOException if the JSON string is invalid with respect to ArraySharing + */ public static ArraySharing fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArraySharing.class); } - /** - * Convert an instance of ArraySharing to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArraySharing 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/model/ArrayTask.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTask.java index 9936150..df8cd92 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTask.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTask.java @@ -14,33 +14,46 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActivityLog; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.ArrayTaskStatus; +import io.tiledb.cloud.rest_api.model.ArrayTaskType; +import io.tiledb.cloud.rest_api.model.DomainArray; +import io.tiledb.cloud.rest_api.model.Querytype; +import io.tiledb.cloud.rest_api.model.ResultFormat; import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -48,8 +61,7 @@ /** * Synchronous Task to Run */ -@ApiModel(description = "Synchronous Task to Run") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayTask { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -137,7 +149,7 @@ public class ArrayTask { public static final String SERIALIZED_NAME_ACTIVITY = "activity"; @SerializedName(SERIALIZED_NAME_ACTIVITY) - private List activity = null; + private List activity = new ArrayList<>(); public static final String SERIALIZED_NAME_LOGS = "logs"; @SerializedName(SERIALIZED_NAME_LOGS) @@ -149,11 +161,11 @@ public class ArrayTask { public static final String SERIALIZED_NAME_SQL_INIT_COMMANDS = "sql_init_commands"; @SerializedName(SERIALIZED_NAME_SQL_INIT_COMMANDS) - private List sqlInitCommands = null; + private List sqlInitCommands = new ArrayList<>(); public static final String SERIALIZED_NAME_SQL_PARAMETERS = "sql_parameters"; @SerializedName(SERIALIZED_NAME_SQL_PARAMETERS) - private List sqlParameters = null; + private List sqlParameters = new ArrayList<>(); public static final String SERIALIZED_NAME_RESULT_FORMAT = "result_format"; @SerializedName(SERIALIZED_NAME_RESULT_FORMAT) @@ -175,494 +187,409 @@ public class ArrayTask { @SerializedName(SERIALIZED_NAME_CLOUD_REGION) private String cloudRegion; - public ArrayTask() { + public ArrayTask() { } public ArrayTask id(String id) { - this.id = id; return this; } - /** + /** * task ID * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "task ID") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public ArrayTask name(String name) { - this.name = name; return this; } - /** + /** * Optional task name * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "subarray-multiplier", value = "Optional task name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public ArrayTask username(String username) { - this.username = username; return this; } - /** + /** * username that executed this task * @return username - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "demo", value = "username that executed this task") - public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } public ArrayTask description(String description) { - this.description = description; return this; } - /** + /** * Optional task description (Tasks purpose) * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "Return attr a1 in the subarray bounded by coordinates and multiply attr1 by 2", value = "Optional task description (Tasks purpose)") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public ArrayTask arrayMetadata(ArrayInfo arrayMetadata) { - this.arrayMetadata = arrayMetadata; return this; } - /** + /** * Get arrayMetadata * @return arrayMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayInfo getArrayMetadata() { return arrayMetadata; } - public void setArrayMetadata(ArrayInfo arrayMetadata) { this.arrayMetadata = arrayMetadata; } public ArrayTask subarray(DomainArray subarray) { - this.subarray = subarray; return this; } - /** + /** * Get subarray * @return subarray - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DomainArray getSubarray() { return subarray; } - public void setSubarray(DomainArray subarray) { this.subarray = subarray; } public ArrayTask memory(Integer memory) { - this.memory = memory; return this; } - /** + /** * memory allocated to task in bytes * @return memory - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "memory allocated to task in bytes") - public Integer getMemory() { return memory; } - public void setMemory(Integer memory) { this.memory = memory; } public ArrayTask cpu(Integer cpu) { - this.cpu = cpu; return this; } - /** + /** * millicpu allocated to task * @return cpu - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "4000", value = "millicpu allocated to task") - public Integer getCpu() { return cpu; } - public void setCpu(Integer cpu) { this.cpu = cpu; } public ArrayTask namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace task is tied to * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "organization1", value = "namespace task is tied to") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public ArrayTask status(ArrayTaskStatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayTaskStatus getStatus() { return status; } - public void setStatus(ArrayTaskStatus status) { this.status = status; } public ArrayTask statusMessage(String statusMessage) { - this.statusMessage = statusMessage; return this; } - /** + /** * The reason the array task status is in the state * @return statusMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The reason the array task status is in the state") - public String getStatusMessage() { return statusMessage; } - public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } public ArrayTask startTime(OffsetDateTime startTime) { - this.startTime = startTime; return this; } - /** + /** * Start time RFC3339 for job * @return startTime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Start time RFC3339 for job") - public OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(OffsetDateTime startTime) { this.startTime = startTime; } public ArrayTask finishTime(OffsetDateTime finishTime) { - this.finishTime = finishTime; return this; } - /** + /** * Finish time RFC3339 for job * @return finishTime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Finish time RFC3339 for job") - public OffsetDateTime getFinishTime() { return finishTime; } - public void setFinishTime(OffsetDateTime finishTime) { this.finishTime = finishTime; } public ArrayTask cost(Double cost) { - this.cost = cost; return this; } - /** + /** * Total accumulated for task in USD, example is $0.12 * @return cost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "0.12", value = "Total accumulated for task in USD, example is $0.12") - public Double getCost() { return cost; } - public void setCost(Double cost) { this.cost = cost; } public ArrayTask egressCost(Double egressCost) { - this.egressCost = egressCost; return this; } - /** + /** * Total accumulated for egress task in USD, example is $0.12 * @return egressCost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "0.12", value = "Total accumulated for egress task in USD, example is $0.12") - public Double getEgressCost() { return egressCost; } - public void setEgressCost(Double egressCost) { this.egressCost = egressCost; } public ArrayTask accessCost(Double accessCost) { - this.accessCost = accessCost; return this; } - /** + /** * Cost accumulated for access task in USD, example is $0.12 * @return accessCost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "0.12", value = "Cost accumulated for access task in USD, example is $0.12") - public Double getAccessCost() { return accessCost; } - public void setAccessCost(Double accessCost) { this.accessCost = accessCost; } public ArrayTask queryType(Querytype queryType) { - this.queryType = queryType; return this; } - /** + /** * Get queryType * @return queryType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Querytype getQueryType() { return queryType; } - public void setQueryType(Querytype queryType) { this.queryType = queryType; } public ArrayTask udfCode(String udfCode) { - this.udfCode = udfCode; return this; } - /** + /** * Optional actual code that is going to be executed * @return udfCode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional actual code that is going to be executed") - public String getUdfCode() { return udfCode; } - public void setUdfCode(String udfCode) { this.udfCode = udfCode; } public ArrayTask udfLanguage(String udfLanguage) { - this.udfLanguage = udfLanguage; return this; } - /** + /** * Optional actual language used to express udf_code * @return udfLanguage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional actual language used to express udf_code") - public String getUdfLanguage() { return udfLanguage; } - public void setUdfLanguage(String udfLanguage) { this.udfLanguage = udfLanguage; } public ArrayTask sqlQuery(String sqlQuery) { - this.sqlQuery = sqlQuery; return this; } - /** + /** * Optional actual sql query that is going to be executed * @return sqlQuery - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional actual sql query that is going to be executed") - public String getSqlQuery() { return sqlQuery; } - public void setSqlQuery(String sqlQuery) { this.sqlQuery = sqlQuery; } public ArrayTask type(ArrayTaskType type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayTaskType getType() { return type; } - public void setType(ArrayTaskType type) { this.type = type; } public ArrayTask activity(List activity) { - this.activity = activity; return this; } @@ -675,71 +602,59 @@ public ArrayTask addActivityItem(ArrayActivityLog activityItem) { return this; } - /** + /** * Array activity logs for task * @return activity - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Array activity logs for task") - public List getActivity() { return activity; } - public void setActivity(List activity) { this.activity = activity; } public ArrayTask logs(String logs) { - this.logs = logs; return this; } - /** + /** * logs from array task * @return logs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logs from array task") - public String getLogs() { return logs; } - public void setLogs(String logs) { this.logs = logs; } public ArrayTask duration(BigDecimal duration) { - this.duration = duration; return this; } - /** + /** * duration in nanoseconds of an array task * @return duration - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "3.41E+11", value = "duration in nanoseconds of an array task") - public BigDecimal getDuration() { return duration; } - public void setDuration(BigDecimal duration) { this.duration = duration; } public ArrayTask sqlInitCommands(List sqlInitCommands) { - this.sqlInitCommands = sqlInitCommands; return this; } @@ -752,25 +667,21 @@ public ArrayTask addSqlInitCommandsItem(String sqlInitCommandsItem) { return this; } - /** + /** * SQL queries or commands to run before main sql query * @return sqlInitCommands - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "SQL queries or commands to run before main sql query") - public List getSqlInitCommands() { return sqlInitCommands; } - public void setSqlInitCommands(List sqlInitCommands) { this.sqlInitCommands = sqlInitCommands; } public ArrayTask sqlParameters(List sqlParameters) { - this.sqlParameters = sqlParameters; return this; } @@ -783,172 +694,114 @@ public ArrayTask addSqlParametersItem(Object sqlParametersItem) { return this; } - /** + /** * SQL query parameters * @return sqlParameters - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "SQL query parameters") - public List getSqlParameters() { return sqlParameters; } - public void setSqlParameters(List sqlParameters) { this.sqlParameters = sqlParameters; } public ArrayTask resultFormat(ResultFormat resultFormat) { - this.resultFormat = resultFormat; return this; } - /** + /** * Get resultFormat * @return resultFormat - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ResultFormat getResultFormat() { return resultFormat; } - public void setResultFormat(ResultFormat resultFormat) { this.resultFormat = resultFormat; } public ArrayTask taskGraphUuid(String taskGraphUuid) { - this.taskGraphUuid = taskGraphUuid; return this; } - /** + /** * If set, the ID of the log for the task graph that this was part of. * @return taskGraphUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the ID of the log for the task graph that this was part of. ") - public String getTaskGraphUuid() { return taskGraphUuid; } - public void setTaskGraphUuid(String taskGraphUuid) { this.taskGraphUuid = taskGraphUuid; } public ArrayTask clientNodeUuid(String clientNodeUuid) { - this.clientNodeUuid = clientNodeUuid; return this; } - /** + /** * If set, the client-defined ID of the node within this task's graph. * @return clientNodeUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the client-defined ID of the node within this task's graph. ") - public String getClientNodeUuid() { return clientNodeUuid; } - public void setClientNodeUuid(String clientNodeUuid) { this.clientNodeUuid = clientNodeUuid; } public ArrayTask cloudProvider(String cloudProvider) { - this.cloudProvider = cloudProvider; return this; } - /** + /** * The name of the cloud provider where this task executed. * @return cloudProvider - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the cloud provider where this task executed.") - public String getCloudProvider() { return cloudProvider; } - public void setCloudProvider(String cloudProvider) { this.cloudProvider = cloudProvider; } public ArrayTask cloudRegion(String cloudRegion) { - this.cloudRegion = cloudRegion; return this; } - /** + /** * The region of the cloud provider where this task executed. * @return cloudRegion - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The region of the cloud provider where this task executed.") - public String getCloudRegion() { return cloudRegion; } - public void setCloudRegion(String cloudRegion) { this.cloudRegion = cloudRegion; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayTask putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -990,8 +843,7 @@ public boolean equals(Object o) { Objects.equals(this.taskGraphUuid, arrayTask.taskGraphUuid) && Objects.equals(this.clientNodeUuid, arrayTask.clientNodeUuid) && Objects.equals(this.cloudProvider, arrayTask.cloudProvider) && - Objects.equals(this.cloudRegion, arrayTask.cloudRegion)&& - Objects.equals(this.additionalProperties, arrayTask.additionalProperties); + Objects.equals(this.cloudRegion, arrayTask.cloudRegion); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1000,7 +852,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, name, username, description, arrayMetadata, subarray, memory, cpu, namespace, status, statusMessage, startTime, finishTime, cost, egressCost, accessCost, queryType, udfCode, udfLanguage, sqlQuery, type, activity, logs, duration, sqlInitCommands, sqlParameters, resultFormat, taskGraphUuid, clientNodeUuid, cloudProvider, cloudRegion, additionalProperties); + return Objects.hash(id, name, username, description, arrayMetadata, subarray, memory, cpu, namespace, status, statusMessage, startTime, finishTime, cost, egressCost, accessCost, queryType, udfCode, udfLanguage, sqlQuery, type, activity, logs, duration, sqlInitCommands, sqlParameters, resultFormat, taskGraphUuid, clientNodeUuid, cloudProvider, cloudRegion); } private static int hashCodeNullable(JsonNullable a) { @@ -1045,7 +897,6 @@ public String toString() { sb.append(" clientNodeUuid: ").append(toIndentedString(clientNodeUuid)).append("\n"); sb.append(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n"); sb.append(" cloudRegion: ").append(toIndentedString(cloudRegion)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1104,20 +955,115 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayTask - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayTask.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayTask + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayTask.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTask is not found in the empty JSON string", ArrayTask.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayTask.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTask` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); + } + 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("username") != null && !jsonObj.get("username").isJsonNull()) && !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("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 `array_metadata` + if (jsonObj.get("array_metadata") != null && !jsonObj.get("array_metadata").isJsonNull()) { + ArrayInfo.validateJsonElement(jsonObj.get("array_metadata")); + } + // validate the optional field `subarray` + if (jsonObj.get("subarray") != null && !jsonObj.get("subarray").isJsonNull()) { + DomainArray.validateJsonElement(jsonObj.get("subarray")); + } + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + ArrayTaskStatus.validateJsonElement(jsonObj.get("status")); + } + if ((jsonObj.get("status_message") != null && !jsonObj.get("status_message").isJsonNull()) && !jsonObj.get("status_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status_message").toString())); + } + // validate the optional field `query_type` + if (jsonObj.get("query_type") != null && !jsonObj.get("query_type").isJsonNull()) { + Querytype.validateJsonElement(jsonObj.get("query_type")); + } + if ((jsonObj.get("udf_code") != null && !jsonObj.get("udf_code").isJsonNull()) && !jsonObj.get("udf_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `udf_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("udf_code").toString())); + } + if ((jsonObj.get("udf_language") != null && !jsonObj.get("udf_language").isJsonNull()) && !jsonObj.get("udf_language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `udf_language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("udf_language").toString())); + } + if ((jsonObj.get("sql_query") != null && !jsonObj.get("sql_query").isJsonNull()) && !jsonObj.get("sql_query").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sql_query` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sql_query").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + ArrayTaskType.validateJsonElement(jsonObj.get("type")); + } + if (jsonObj.get("activity") != null && !jsonObj.get("activity").isJsonNull()) { + JsonArray jsonArrayactivity = jsonObj.getAsJsonArray("activity"); + if (jsonArrayactivity != null) { + // ensure the json data is an array + if (!jsonObj.get("activity").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `activity` to be an array in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + + // validate the optional field `activity` (array) + for (int i = 0; i < jsonArrayactivity.size(); i++) { + ArrayActivityLog.validateJsonElement(jsonArrayactivity.get(i)); + }; + } + } + if ((jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonNull()) && !jsonObj.get("logs").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("sql_init_commands") != null && !jsonObj.get("sql_init_commands").isJsonNull() && !jsonObj.get("sql_init_commands").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sql_init_commands` to be an array in the JSON string but got `%s`", jsonObj.get("sql_init_commands").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("sql_parameters") != null && !jsonObj.get("sql_parameters").isJsonNull() && !jsonObj.get("sql_parameters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sql_parameters` to be an array in the JSON string but got `%s`", jsonObj.get("sql_parameters").toString())); + } + // validate the optional field `result_format` + if (jsonObj.get("result_format") != null && !jsonObj.get("result_format").isJsonNull()) { + ResultFormat.validateJsonElement(jsonObj.get("result_format")); + } + if ((jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonNull()) && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_graph_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_graph_uuid").toString())); + } + if ((jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonNull()) && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_node_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_uuid").toString())); + } + if ((jsonObj.get("cloud_provider") != null && !jsonObj.get("cloud_provider").isJsonNull()) && !jsonObj.get("cloud_provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cloud_provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cloud_provider").toString())); + } + if ((jsonObj.get("cloud_region") != null && !jsonObj.get("cloud_region").isJsonNull()) && !jsonObj.get("cloud_region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cloud_region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cloud_region").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -1135,71 +1081,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayTask value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayTask read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayTask instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayTask given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTask - * @throws IOException if the JSON string is invalid with respect to ArrayTask - */ + /** + * Create an instance of ArrayTask given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTask + * @throws IOException if the JSON string is invalid with respect to ArrayTask + */ public static ArrayTask fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTask.class); } - /** - * Convert an instance of ArrayTask to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTask 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/model/ArrayTaskBrowserSidebar.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebar.java index be6a49e..5838f81 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebar.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebar.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,12 +51,11 @@ /** * Object for ui array tasks browser page */ -@ApiModel(description = "Object for ui array tasks browser page") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayTaskBrowserSidebar { public static final String SERIALIZED_NAME_ORGANIZATIONS = "organizations"; @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) - private List organizations = null; + private List organizations = new ArrayList<>(); public static final String SERIALIZED_NAME_RESULT_COUNT_FOR_ALL = "result_count_for_all"; @SerializedName(SERIALIZED_NAME_RESULT_COUNT_FOR_ALL) @@ -58,11 +65,10 @@ public class ArrayTaskBrowserSidebar { @SerializedName(SERIALIZED_NAME_RESULT_COUNT_BY_NAMESPACE) private Object resultCountByNamespace; - public ArrayTaskBrowserSidebar() { + public ArrayTaskBrowserSidebar() { } public ArrayTaskBrowserSidebar organizations(List organizations) { - this.organizations = organizations; return this; } @@ -75,103 +81,57 @@ public ArrayTaskBrowserSidebar addOrganizationsItem(String organizationsItem) { return this; } - /** + /** * list of all unique organizations the user is part of that have array tasks * @return organizations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of all unique organizations the user is part of that have array tasks") - public List getOrganizations() { return organizations; } - public void setOrganizations(List organizations) { this.organizations = organizations; } public ArrayTaskBrowserSidebar resultCountForAll(Integer resultCountForAll) { - this.resultCountForAll = resultCountForAll; return this; } - /** + /** * A count of \"all\" * @return resultCountForAll - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A count of \"all\"") - public Integer getResultCountForAll() { return resultCountForAll; } - public void setResultCountForAll(Integer resultCountForAll) { this.resultCountForAll = resultCountForAll; } public ArrayTaskBrowserSidebar resultCountByNamespace(Object resultCountByNamespace) { - this.resultCountByNamespace = resultCountByNamespace; return this; } - /** + /** * A map that includes the result count by namespace * @return resultCountByNamespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A map that includes the result count by namespace") - public Object getResultCountByNamespace() { return resultCountByNamespace; } - public void setResultCountByNamespace(Object resultCountByNamespace) { this.resultCountByNamespace = resultCountByNamespace; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayTaskBrowserSidebar putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -185,13 +145,12 @@ public boolean equals(Object o) { ArrayTaskBrowserSidebar arrayTaskBrowserSidebar = (ArrayTaskBrowserSidebar) o; return Objects.equals(this.organizations, arrayTaskBrowserSidebar.organizations) && Objects.equals(this.resultCountForAll, arrayTaskBrowserSidebar.resultCountForAll) && - Objects.equals(this.resultCountByNamespace, arrayTaskBrowserSidebar.resultCountByNamespace)&& - Objects.equals(this.additionalProperties, arrayTaskBrowserSidebar.additionalProperties); + Objects.equals(this.resultCountByNamespace, arrayTaskBrowserSidebar.resultCountByNamespace); } @Override public int hashCode() { - return Objects.hash(organizations, resultCountForAll, resultCountByNamespace, additionalProperties); + return Objects.hash(organizations, resultCountForAll, resultCountByNamespace); } @Override @@ -201,7 +160,6 @@ public String toString() { sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); sb.append(" resultCountForAll: ").append(toIndentedString(resultCountForAll)).append("\n"); sb.append(" resultCountByNamespace: ").append(toIndentedString(resultCountByNamespace)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -232,22 +190,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayTaskBrowserSidebar - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayTaskBrowserSidebar.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayTaskBrowserSidebar + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayTaskBrowserSidebar.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTaskBrowserSidebar is not found in the empty JSON string", ArrayTaskBrowserSidebar.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("organizations") != null && !jsonObj.get("organizations").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayTaskBrowserSidebar.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTaskBrowserSidebar` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("organizations") != null && !jsonObj.get("organizations").isJsonNull() && !jsonObj.get("organizations").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `organizations` to be an array in the JSON string but got `%s`", jsonObj.get("organizations").toString())); } } @@ -267,71 +232,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayTaskBrowserSidebar value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayTaskBrowserSidebar read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayTaskBrowserSidebar instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayTaskBrowserSidebar given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTaskBrowserSidebar - * @throws IOException if the JSON string is invalid with respect to ArrayTaskBrowserSidebar - */ + /** + * Create an instance of ArrayTaskBrowserSidebar given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTaskBrowserSidebar + * @throws IOException if the JSON string is invalid with respect to ArrayTaskBrowserSidebar + */ public static ArrayTaskBrowserSidebar fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTaskBrowserSidebar.class); } - /** - * Convert an instance of ArrayTaskBrowserSidebar to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTaskBrowserSidebar 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/model/ArrayTaskData.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskData.java index 3aa34ad..2eeca0f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskData.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayTask; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Object including array tasks and metadata */ -@ApiModel(description = "Object including array tasks and metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayTaskData { public static final String SERIALIZED_NAME_ARRAY_TASKS = "array_tasks"; @SerializedName(SERIALIZED_NAME_ARRAY_TASKS) - private List arrayTasks = null; + private List arrayTasks = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public ArrayTaskData() { + public ArrayTaskData() { } public ArrayTaskData arrayTasks(List arrayTasks) { - this.arrayTasks = arrayTasks; return this; } @@ -72,80 +79,38 @@ public ArrayTaskData addArrayTasksItem(ArrayTask arrayTasksItem) { return this; } - /** + /** * Array Tasks * @return arrayTasks - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Array Tasks") - public List getArrayTasks() { return arrayTasks; } - public void setArrayTasks(List arrayTasks) { this.arrayTasks = arrayTasks; } public ArrayTaskData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayTaskData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } ArrayTaskData arrayTaskData = (ArrayTaskData) o; return Objects.equals(this.arrayTasks, arrayTaskData.arrayTasks) && - Objects.equals(this.paginationMetadata, arrayTaskData.paginationMetadata)&& - Objects.equals(this.additionalProperties, arrayTaskData.additionalProperties); + Objects.equals(this.paginationMetadata, arrayTaskData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(arrayTasks, paginationMetadata, additionalProperties); + return Objects.hash(arrayTasks, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class ArrayTaskData {\n"); sb.append(" arrayTasks: ").append(toIndentedString(arrayTasks)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayTaskData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayTaskData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayTaskData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayTaskData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTaskData is not found in the empty JSON string", ArrayTaskData.openapiRequiredFields.toString())); } } - JsonArray jsonArrayarrayTasks = jsonObj.getAsJsonArray("array_tasks"); - if (jsonArrayarrayTasks != null) { - // ensure the json data is an array - if (!jsonObj.get("array_tasks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `array_tasks` to be an array in the JSON string but got `%s`", jsonObj.get("array_tasks").toString())); - } - // validate the optional field `array_tasks` (array) - for (int i = 0; i < jsonArrayarrayTasks.size(); i++) { - ArrayTask.validateJsonObject(jsonArrayarrayTasks.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayTaskData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTaskData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("array_tasks") != null && !jsonObj.get("array_tasks").isJsonNull()) { + JsonArray jsonArrayarrayTasks = jsonObj.getAsJsonArray("array_tasks"); + if (jsonArrayarrayTasks != null) { + // ensure the json data is an array + if (!jsonObj.get("array_tasks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `array_tasks` to be an array in the JSON string but got `%s`", jsonObj.get("array_tasks").toString())); + } + + // validate the optional field `array_tasks` (array) + for (int i = 0; i < jsonArrayarrayTasks.size(); i++) { + ArrayTask.validateJsonElement(jsonArrayarrayTasks.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayTaskData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayTaskData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayTaskData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayTaskData given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTaskData - * @throws IOException if the JSON string is invalid with respect to ArrayTaskData - */ + /** + * Create an instance of ArrayTaskData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTaskData + * @throws IOException if the JSON string is invalid with respect to ArrayTaskData + */ public static ArrayTaskData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTaskData.class); } - /** - * Convert an instance of ArrayTaskData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTaskData 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/model/ArrayTaskLog.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskLog.java index 893238a..52bb7a9 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskLog.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskLog.java @@ -14,34 +14,42 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Array task stderr/stdout logs */ -@ApiModel(description = "Array task stderr/stdout logs") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayTaskLog { public static final String SERIALIZED_NAME_ARRAY_TASK_ID = "array_task_id"; @SerializedName(SERIALIZED_NAME_ARRAY_TASK_ID) @@ -51,89 +59,46 @@ public class ArrayTaskLog { @SerializedName(SERIALIZED_NAME_LOGS) private String logs; - public ArrayTaskLog() { + public ArrayTaskLog() { } public ArrayTaskLog arrayTaskId(String arrayTaskId) { - this.arrayTaskId = arrayTaskId; return this; } - /** + /** * ID of associated task * @return arrayTaskId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "ID of associated task") - public String getArrayTaskId() { return arrayTaskId; } - public void setArrayTaskId(String arrayTaskId) { this.arrayTaskId = arrayTaskId; } public ArrayTaskLog logs(String logs) { - this.logs = logs; return this; } - /** + /** * logs from array task * @return logs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logs from array task") - public String getLogs() { return logs; } - public void setLogs(String logs) { this.logs = logs; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayTaskLog putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -146,13 +111,12 @@ public boolean equals(Object o) { } ArrayTaskLog arrayTaskLog = (ArrayTaskLog) o; return Objects.equals(this.arrayTaskId, arrayTaskLog.arrayTaskId) && - Objects.equals(this.logs, arrayTaskLog.logs)&& - Objects.equals(this.additionalProperties, arrayTaskLog.additionalProperties); + Objects.equals(this.logs, arrayTaskLog.logs); } @Override public int hashCode() { - return Objects.hash(arrayTaskId, logs, additionalProperties); + return Objects.hash(arrayTaskId, logs); } @Override @@ -161,7 +125,6 @@ public String toString() { sb.append("class ArrayTaskLog {\n"); sb.append(" arrayTaskId: ").append(toIndentedString(arrayTaskId)).append("\n"); sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -191,24 +154,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayTaskLog - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayTaskLog.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayTaskLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayTaskLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTaskLog is not found in the empty JSON string", ArrayTaskLog.openapiRequiredFields.toString())); } } - if (jsonObj.get("array_task_id") != null && !jsonObj.get("array_task_id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayTaskLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTaskLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("array_task_id") != null && !jsonObj.get("array_task_id").isJsonNull()) && !jsonObj.get("array_task_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_task_id").toString())); } - if (jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonPrimitive()) { + if ((jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonNull()) && !jsonObj.get("logs").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logs").toString())); } } @@ -228,71 +198,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayTaskLog value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayTaskLog read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayTaskLog instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayTaskLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTaskLog - * @throws IOException if the JSON string is invalid with respect to ArrayTaskLog - */ + /** + * Create an instance of ArrayTaskLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTaskLog + * @throws IOException if the JSON string is invalid with respect to ArrayTaskLog + */ public static ArrayTaskLog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTaskLog.class); } - /** - * Convert an instance of ArrayTaskLog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTaskLog 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/model/ArrayTaskStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatus.java index 8bd2657..e9d6c30 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -80,5 +81,10 @@ public ArrayTaskStatus read(final JsonReader jsonReader) throws IOException { return ArrayTaskStatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ArrayTaskStatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskType.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskType.java index d54bd08..7d9b9ff 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayTaskType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -76,5 +77,10 @@ public ArrayTaskType read(final JsonReader jsonReader) throws IOException { return ArrayTaskType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ArrayTaskType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayType.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayType.java index d433ac7..04a1a8f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public ArrayType read(final JsonReader jsonReader) throws IOException { return ArrayType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ArrayType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequest.java index b95848a..907bfe8 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequest.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TileDBConfig; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,73 +50,33 @@ /** * Request to consolidate an array */ -@ApiModel(description = "Request to consolidate an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ArrayVacuumRequest { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) private TileDBConfig config; - public ArrayVacuumRequest() { + public ArrayVacuumRequest() { } public ArrayVacuumRequest config(TileDBConfig config) { - this.config = config; return this; } - /** + /** * Get config * @return config - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TileDBConfig getConfig() { return config; } - public void setConfig(TileDBConfig config) { this.config = config; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayVacuumRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -119,13 +88,12 @@ public boolean equals(Object o) { return false; } ArrayVacuumRequest arrayVacuumRequest = (ArrayVacuumRequest) o; - return Objects.equals(this.config, arrayVacuumRequest.config)&& - Objects.equals(this.additionalProperties, arrayVacuumRequest.additionalProperties); + return Objects.equals(this.config, arrayVacuumRequest.config); } @Override public int hashCode() { - return Objects.hash(config, additionalProperties); + return Objects.hash(config); } @Override @@ -133,7 +101,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ArrayVacuumRequest {\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -162,23 +129,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ArrayVacuumRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayVacuumRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ArrayVacuumRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ArrayVacuumRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayVacuumRequest is not found in the empty JSON string", ArrayVacuumRequest.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ArrayVacuumRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayVacuumRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `config` - if (jsonObj.getAsJsonObject("config") != null) { - TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + TileDBConfig.validateJsonElement(jsonObj.get("config")); } } @@ -197,71 +171,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ArrayVacuumRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ArrayVacuumRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayVacuumRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ArrayVacuumRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayVacuumRequest - * @throws IOException if the JSON string is invalid with respect to ArrayVacuumRequest - */ + /** + * Create an instance of ArrayVacuumRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayVacuumRequest + * @throws IOException if the JSON string is invalid with respect to ArrayVacuumRequest + */ public static ArrayVacuumRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayVacuumRequest.class); } - /** - * Convert an instance of ArrayVacuumRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayVacuumRequest 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/model/AssetBackingType.java b/src/main/java/io/tiledb/cloud/rest_api/model/AssetBackingType.java index 9e1a234..245433c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AssetBackingType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AssetBackingType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public AssetBackingType read(final JsonReader jsonReader) throws IOException { 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/model/AssetInfo.java b/src/main/java/io/tiledb/cloud/rest_api/model/AssetInfo.java index 720cd2f..e969768 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AssetInfo.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AssetInfo.java @@ -14,27 +14,39 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AssetBackingType; +import io.tiledb.cloud.rest_api.model.AssetOwnershipLevel; +import io.tiledb.cloud.rest_api.model.AssetType; +import io.tiledb.cloud.rest_api.model.MetadataStringified; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +54,7 @@ /** * metadata of an asset */ -@ApiModel(description = "metadata of an asset") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class AssetInfo { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) @@ -85,10 +96,9 @@ public class AssetInfo { @SerializedName(SERIALIZED_NAME_METADATA) private MetadataStringified metadata; - public AssetInfo() { + public AssetInfo() { } - public AssetInfo( OffsetDateTime createdAt ) { @@ -97,260 +107,186 @@ public AssetInfo( } public AssetInfo uuid(String uuid) { - this.uuid = uuid; return this; } - /** + /** * unique ID of a registered asset * @return uuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of a registered asset") - public String getUuid() { return uuid; } - public void setUuid(String uuid) { this.uuid = uuid; } public AssetInfo assetType(AssetType assetType) { - this.assetType = assetType; return this; } - /** + /** * Get assetType * @return assetType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetType getAssetType() { return assetType; } - public void setAssetType(AssetType assetType) { this.assetType = assetType; } public AssetInfo assetBackingType(AssetBackingType assetBackingType) { - this.assetBackingType = assetBackingType; return this; } - /** + /** * Get assetBackingType * @return assetBackingType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetBackingType getAssetBackingType() { return assetBackingType; } - public void setAssetBackingType(AssetBackingType assetBackingType) { this.assetBackingType = assetBackingType; } public AssetInfo assetOwnershipLevel(AssetOwnershipLevel assetOwnershipLevel) { - this.assetOwnershipLevel = assetOwnershipLevel; return this; } - /** + /** * Get assetOwnershipLevel * @return assetOwnershipLevel - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetOwnershipLevel getAssetOwnershipLevel() { return assetOwnershipLevel; } - public void setAssetOwnershipLevel(AssetOwnershipLevel assetOwnershipLevel) { this.assetOwnershipLevel = assetOwnershipLevel; } public AssetInfo namespaceName(String namespaceName) { - this.namespaceName = namespaceName; return this; } - /** + /** * namespace_name that the asset is registered to * @return namespaceName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "user1", value = "namespace_name that the asset is registered to") - public String getNamespaceName() { return namespaceName; } - public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } public AssetInfo namespaceUuid(String namespaceUuid) { - this.namespaceUuid = namespaceUuid; return this; } - /** + /** * namespace_uuid that the asset is registered to * @return namespaceUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "namespace_uuid that the asset is registered to") - public String getNamespaceUuid() { return namespaceUuid; } - public void setNamespaceUuid(String namespaceUuid) { this.namespaceUuid = namespaceUuid; } public AssetInfo name(String name) { - this.name = name; return this; } - /** + /** * name of asset * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "myarray1", value = "name of asset") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public AssetInfo mimeType(String mimeType) { - this.mimeType = mimeType; return this; } - /** + /** * mime type of the asset * @return mimeType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "application/vnd.tiledb.v1.array", value = "mime type of the asset") - public String getMimeType() { return mimeType; } - public void setMimeType(String mimeType) { this.mimeType = mimeType; } - /** + /** * Time when the asset was created (rfc3339) * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time when the asset was created (rfc3339)") - public OffsetDateTime getCreatedAt() { return createdAt; } - public AssetInfo metadata(MetadataStringified metadata) { - this.metadata = metadata; return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public MetadataStringified getMetadata() { return metadata; } - public void setMetadata(MetadataStringified metadata) { this.metadata = metadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public AssetInfo putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -371,13 +307,12 @@ public boolean equals(Object o) { Objects.equals(this.name, assetInfo.name) && Objects.equals(this.mimeType, assetInfo.mimeType) && Objects.equals(this.createdAt, assetInfo.createdAt) && - Objects.equals(this.metadata, assetInfo.metadata)&& - Objects.equals(this.additionalProperties, assetInfo.additionalProperties); + Objects.equals(this.metadata, assetInfo.metadata); } @Override public int hashCode() { - return Objects.hash(uuid, assetType, assetBackingType, assetOwnershipLevel, namespaceName, namespaceUuid, name, mimeType, createdAt, metadata, additionalProperties); + return Objects.hash(uuid, assetType, assetBackingType, assetOwnershipLevel, namespaceName, namespaceUuid, name, mimeType, createdAt, metadata); } @Override @@ -394,7 +329,6 @@ public String toString() { sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -432,38 +366,57 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AssetInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AssetInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 AssetInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in AssetInfo is not found in the empty JSON string", AssetInfo.openapiRequiredFields.toString())); } } - if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); } - if (jsonObj.get("namespace_name") != null && !jsonObj.get("namespace_name").isJsonPrimitive()) { + // validate the optional field `asset_type` + if (jsonObj.get("asset_type") != null && !jsonObj.get("asset_type").isJsonNull()) { + AssetType.validateJsonElement(jsonObj.get("asset_type")); + } + // validate the optional field `asset_backing_type` + if (jsonObj.get("asset_backing_type") != null && !jsonObj.get("asset_backing_type").isJsonNull()) { + AssetBackingType.validateJsonElement(jsonObj.get("asset_backing_type")); + } + // validate the optional field `asset_ownership_level` + if (jsonObj.get("asset_ownership_level") != null && !jsonObj.get("asset_ownership_level").isJsonNull()) { + AssetOwnershipLevel.validateJsonElement(jsonObj.get("asset_ownership_level")); + } + if ((jsonObj.get("namespace_name") != null && !jsonObj.get("namespace_name").isJsonNull()) && !jsonObj.get("namespace_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_name").toString())); } - if (jsonObj.get("namespace_uuid") != null && !jsonObj.get("namespace_uuid").isJsonPrimitive()) { + if ((jsonObj.get("namespace_uuid") != null && !jsonObj.get("namespace_uuid").isJsonNull()) && !jsonObj.get("namespace_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_uuid").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("mime_type") != null && !jsonObj.get("mime_type").isJsonPrimitive()) { + if ((jsonObj.get("mime_type") != null && !jsonObj.get("mime_type").isJsonNull()) && !jsonObj.get("mime_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `mime_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mime_type").toString())); } // validate the optional field `metadata` - if (jsonObj.getAsJsonObject("metadata") != null) { - MetadataStringified.validateJsonObject(jsonObj.getAsJsonObject("metadata")); + if (jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) { + MetadataStringified.validateJsonElement(jsonObj.get("metadata")); } } @@ -482,71 +435,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AssetInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public AssetInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - AssetInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of AssetInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of AssetInfo - * @throws IOException if the JSON string is invalid with respect to AssetInfo - */ + /** + * Create an instance of AssetInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetInfo + * @throws IOException if the JSON string is invalid with respect to AssetInfo + */ public static AssetInfo fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AssetInfo.class); } - /** - * Convert an instance of AssetInfo to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AssetInfo 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/model/AssetListResponse.java b/src/main/java/io/tiledb/cloud/rest_api/model/AssetListResponse.java index 8d65a6d..7ca1266 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AssetListResponse.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AssetListResponse.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AssetInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Asset associated with a TileDB Cloud account */ -@ApiModel(description = "Asset associated with a TileDB Cloud account") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class AssetListResponse { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private List data = null; + private List data = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public AssetListResponse() { + public AssetListResponse() { } public AssetListResponse data(List data) { - this.data = data; return this; } @@ -72,80 +79,38 @@ public AssetListResponse addDataItem(AssetInfo dataItem) { return this; } - /** + /** * asset information for each asset * @return data - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "asset information for each asset") - public List getData() { return data; } - public void setData(List data) { this.data = data; } public AssetListResponse paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public AssetListResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } AssetListResponse assetListResponse = (AssetListResponse) o; return Objects.equals(this.data, assetListResponse.data) && - Objects.equals(this.paginationMetadata, assetListResponse.paginationMetadata)&& - Objects.equals(this.additionalProperties, assetListResponse.additionalProperties); + Objects.equals(this.paginationMetadata, assetListResponse.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(data, paginationMetadata, additionalProperties); + return Objects.hash(data, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class AssetListResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AssetListResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AssetListResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); } } - JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); - if (jsonArraydata != null) { - // 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())); - } - // validate the optional field `data` (array) - for (int i = 0; i < jsonArraydata.size(); i++) { - AssetInfo.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + 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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // 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())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + AssetInfo.validateJsonElement(jsonArraydata.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AssetListResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public AssetListResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - AssetListResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/AssetLocations.java b/src/main/java/io/tiledb/cloud/rest_api/model/AssetLocations.java index dfee890..6384efa 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AssetLocations.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AssetLocations.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.StorageLocation; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * Custom storage locations on a per–asset type basis. If any is unset, a suffix of the owning (user/organization) `default_s3_path` is used. */ -@ApiModel(description = "Custom storage locations on a per–asset type basis. If any is unset, a suffix of the owning (user/organization) `default_s3_path` is used. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class AssetLocations { public static final String SERIALIZED_NAME_ARRAYS = "arrays"; @SerializedName(SERIALIZED_NAME_ARRAYS) @@ -72,204 +80,141 @@ public class AssetLocations { @SerializedName(SERIALIZED_NAME_UDFS) private StorageLocation udfs; - public AssetLocations() { + public AssetLocations() { } public AssetLocations arrays(StorageLocation arrays) { - this.arrays = arrays; return this; } - /** + /** * Get arrays * @return arrays - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getArrays() { return arrays; } - public void setArrays(StorageLocation arrays) { this.arrays = arrays; } public AssetLocations files(StorageLocation files) { - this.files = files; return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getFiles() { return files; } - public void setFiles(StorageLocation files) { this.files = files; } public AssetLocations groups(StorageLocation groups) { - this.groups = groups; return this; } - /** + /** * Get groups * @return groups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getGroups() { return groups; } - public void setGroups(StorageLocation groups) { this.groups = groups; } public AssetLocations mlModels(StorageLocation mlModels) { - this.mlModels = mlModels; return this; } - /** + /** * Get mlModels * @return mlModels - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getMlModels() { return mlModels; } - public void setMlModels(StorageLocation mlModels) { this.mlModels = mlModels; } public AssetLocations notebooks(StorageLocation notebooks) { - this.notebooks = notebooks; return this; } - /** + /** * Get notebooks * @return notebooks - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getNotebooks() { return notebooks; } - public void setNotebooks(StorageLocation notebooks) { this.notebooks = notebooks; } public AssetLocations taskGraphs(StorageLocation taskGraphs) { - this.taskGraphs = taskGraphs; return this; } - /** + /** * Get taskGraphs * @return taskGraphs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getTaskGraphs() { return taskGraphs; } - public void setTaskGraphs(StorageLocation taskGraphs) { this.taskGraphs = taskGraphs; } public AssetLocations udfs(StorageLocation udfs) { - this.udfs = udfs; return this; } - /** + /** * Get udfs * @return udfs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public StorageLocation getUdfs() { return udfs; } - public void setUdfs(StorageLocation udfs) { this.udfs = udfs; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public AssetLocations putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -287,13 +232,12 @@ public boolean equals(Object o) { Objects.equals(this.mlModels, assetLocations.mlModels) && Objects.equals(this.notebooks, assetLocations.notebooks) && Objects.equals(this.taskGraphs, assetLocations.taskGraphs) && - Objects.equals(this.udfs, assetLocations.udfs)&& - Objects.equals(this.additionalProperties, assetLocations.additionalProperties); + Objects.equals(this.udfs, assetLocations.udfs); } @Override public int hashCode() { - return Objects.hash(arrays, files, groups, mlModels, notebooks, taskGraphs, udfs, additionalProperties); + return Objects.hash(arrays, files, groups, mlModels, notebooks, taskGraphs, udfs); } @Override @@ -307,7 +251,6 @@ public String toString() { sb.append(" notebooks: ").append(toIndentedString(notebooks)).append("\n"); sb.append(" taskGraphs: ").append(toIndentedString(taskGraphs)).append("\n"); sb.append(" udfs: ").append(toIndentedString(udfs)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -342,47 +285,54 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AssetLocations - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AssetLocations.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 AssetLocations + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssetLocations.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in AssetLocations is not found in the empty JSON string", AssetLocations.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssetLocations.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetLocations` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `arrays` - if (jsonObj.getAsJsonObject("arrays") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("arrays")); + if (jsonObj.get("arrays") != null && !jsonObj.get("arrays").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("arrays")); } // validate the optional field `files` - if (jsonObj.getAsJsonObject("files") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("files")); + if (jsonObj.get("files") != null && !jsonObj.get("files").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("files")); } // validate the optional field `groups` - if (jsonObj.getAsJsonObject("groups") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("groups")); + if (jsonObj.get("groups") != null && !jsonObj.get("groups").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("groups")); } // validate the optional field `ml_models` - if (jsonObj.getAsJsonObject("ml_models") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("ml_models")); + if (jsonObj.get("ml_models") != null && !jsonObj.get("ml_models").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("ml_models")); } // validate the optional field `notebooks` - if (jsonObj.getAsJsonObject("notebooks") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("notebooks")); + if (jsonObj.get("notebooks") != null && !jsonObj.get("notebooks").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("notebooks")); } // validate the optional field `task_graphs` - if (jsonObj.getAsJsonObject("task_graphs") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("task_graphs")); + if (jsonObj.get("task_graphs") != null && !jsonObj.get("task_graphs").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("task_graphs")); } // validate the optional field `udfs` - if (jsonObj.getAsJsonObject("udfs") != null) { - StorageLocation.validateJsonObject(jsonObj.getAsJsonObject("udfs")); + if (jsonObj.get("udfs") != null && !jsonObj.get("udfs").isJsonNull()) { + StorageLocation.validateJsonElement(jsonObj.get("udfs")); } } @@ -401,71 +351,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AssetLocations value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public AssetLocations read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - AssetLocations instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of AssetLocations given an JSON string - * - * @param jsonString JSON string - * @return An instance of AssetLocations - * @throws IOException if the JSON string is invalid with respect to AssetLocations - */ + /** + * Create an instance of AssetLocations given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetLocations + * @throws IOException if the JSON string is invalid with respect to AssetLocations + */ public static AssetLocations fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AssetLocations.class); } - /** - * Convert an instance of AssetLocations to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AssetLocations 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/model/AssetOwnershipLevel.java b/src/main/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevel.java index 42a42ec..aa10541 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevel.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevel.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public AssetOwnershipLevel read(final JsonReader jsonReader) throws IOException return AssetOwnershipLevel.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssetOwnershipLevel.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/AssetType.java b/src/main/java/io/tiledb/cloud/rest_api/model/AssetType.java index cc5b806..b61544d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AssetType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AssetType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -94,5 +95,10 @@ public AssetType read(final JsonReader jsonReader) throws IOException { 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/model/Attribute.java b/src/main/java/io/tiledb/cloud/rest_api/model/Attribute.java index 342e224..06c78bd 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Attribute.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Attribute.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Datatype; +import io.tiledb.cloud.rest_api.model.FilterPipeline; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +53,7 @@ /** * Attribute of array */ -@ApiModel(description = "Attribute of array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Attribute { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -68,128 +77,107 @@ public class Attribute { public static final String SERIALIZED_NAME_FILL_VALUE = "fillValue"; @SerializedName(SERIALIZED_NAME_FILL_VALUE) - private List fillValue = null; + private List fillValue = new ArrayList<>(); - public Attribute() { + public Attribute() { } public Attribute name(String name) { - this.name = name; return this; } - /** + /** * Attribute name * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "attribute1", required = true, value = "Attribute name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public Attribute type(Datatype type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Datatype getType() { return type; } - public void setType(Datatype type) { this.type = type; } public Attribute filterPipeline(FilterPipeline filterPipeline) { - this.filterPipeline = filterPipeline; return this; } - /** + /** * Get filterPipeline * @return filterPipeline - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public FilterPipeline getFilterPipeline() { return filterPipeline; } - public void setFilterPipeline(FilterPipeline filterPipeline) { this.filterPipeline = filterPipeline; } public Attribute cellValNum(Integer cellValNum) { - this.cellValNum = cellValNum; return this; } - /** + /** * Attribute number of values per cell * @return cellValNum - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "1", required = true, value = "Attribute number of values per cell") - public Integer getCellValNum() { return cellValNum; } - public void setCellValNum(Integer cellValNum) { this.cellValNum = cellValNum; } public Attribute nullable(Boolean nullable) { - this.nullable = nullable; return this; } - /** + /** * Is attribute nullable * @return nullable - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Is attribute nullable") - public Boolean getNullable() { return nullable; } - public void setNullable(Boolean nullable) { this.nullable = nullable; } public Attribute fillValue(List fillValue) { - this.fillValue = fillValue; return this; } @@ -202,57 +190,19 @@ public Attribute addFillValueItem(Integer fillValueItem) { return this; } - /** + /** * The default fill value * @return fillValue - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The default fill value") - public List getFillValue() { return fillValue; } - public void setFillValue(List fillValue) { this.fillValue = fillValue; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Attribute putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -269,13 +219,12 @@ public boolean equals(Object o) { Objects.equals(this.filterPipeline, attribute.filterPipeline) && Objects.equals(this.cellValNum, attribute.cellValNum) && Objects.equals(this.nullable, attribute.nullable) && - Objects.equals(this.fillValue, attribute.fillValue)&& - Objects.equals(this.additionalProperties, attribute.additionalProperties); + Objects.equals(this.fillValue, attribute.fillValue); } @Override public int hashCode() { - return Objects.hash(name, type, filterPipeline, cellValNum, nullable, fillValue, additionalProperties); + return Objects.hash(name, type, filterPipeline, cellValNum, nullable, fillValue); } @Override @@ -288,7 +237,6 @@ public String toString() { sb.append(" cellValNum: ").append(toIndentedString(cellValNum)).append("\n"); sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n"); sb.append(" fillValue: ").append(toIndentedString(fillValue)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -326,36 +274,43 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("cellValNum"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Attribute - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Attribute.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Attribute + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Attribute.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Attribute is not found in the empty JSON string", Attribute.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Attribute.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Attribute` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Attribute.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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 optional field `filterPipeline` - if (jsonObj.getAsJsonObject("filterPipeline") != null) { - FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("filterPipeline")); - } - // ensure the json data is an array - if (jsonObj.get("fillValue") != null && !jsonObj.get("fillValue").isJsonArray()) { + // validate the required field `type` + Datatype.validateJsonElement(jsonObj.get("type")); + // validate the required field `filterPipeline` + FilterPipeline.validateJsonElement(jsonObj.get("filterPipeline")); + // ensure the optional json data is an array if present + if (jsonObj.get("fillValue") != null && !jsonObj.get("fillValue").isJsonNull() && !jsonObj.get("fillValue").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fillValue` to be an array in the JSON string but got `%s`", jsonObj.get("fillValue").toString())); } } @@ -375,71 +330,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Attribute value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Attribute read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Attribute instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Attribute given an JSON string - * - * @param jsonString JSON string - * @return An instance of Attribute - * @throws IOException if the JSON string is invalid with respect to Attribute - */ + /** + * Create an instance of Attribute given an JSON string + * + * @param jsonString JSON string + * @return An instance of Attribute + * @throws IOException if the JSON string is invalid with respect to Attribute + */ public static Attribute fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Attribute.class); } - /** - * Convert an instance of Attribute to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Attribute 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/model/AttributeBufferHeader.java b/src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeader.java index f77ec7c..974127a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeader.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeader.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Represents an attribute buffer header information */ -@ApiModel(description = "Represents an attribute buffer header information") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class AttributeBufferHeader { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -56,112 +63,65 @@ public class AttributeBufferHeader { @SerializedName(SERIALIZED_NAME_VAR_LEN_BUFFER_SIZE_IN_BYTES) private Integer varLenBufferSizeInBytes; - public AttributeBufferHeader() { + public AttributeBufferHeader() { } public AttributeBufferHeader name(String name) { - this.name = name; return this; } - /** + /** * Attribute name * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "attribute1", required = true, value = "Attribute name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public AttributeBufferHeader fixedLenBufferSizeInBytes(Integer fixedLenBufferSizeInBytes) { - this.fixedLenBufferSizeInBytes = fixedLenBufferSizeInBytes; return this; } - /** + /** * Number of bytes in the fixed-length attribute data buffer (offsets for var-len attributes) * @return fixedLenBufferSizeInBytes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Number of bytes in the fixed-length attribute data buffer (offsets for var-len attributes)") - public Integer getFixedLenBufferSizeInBytes() { return fixedLenBufferSizeInBytes; } - public void setFixedLenBufferSizeInBytes(Integer fixedLenBufferSizeInBytes) { this.fixedLenBufferSizeInBytes = fixedLenBufferSizeInBytes; } public AttributeBufferHeader varLenBufferSizeInBytes(Integer varLenBufferSizeInBytes) { - this.varLenBufferSizeInBytes = varLenBufferSizeInBytes; return this; } - /** + /** * Number of bytes in the var-length attribute data buffer * @return varLenBufferSizeInBytes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Number of bytes in the var-length attribute data buffer") - public Integer getVarLenBufferSizeInBytes() { return varLenBufferSizeInBytes; } - public void setVarLenBufferSizeInBytes(Integer varLenBufferSizeInBytes) { this.varLenBufferSizeInBytes = varLenBufferSizeInBytes; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public AttributeBufferHeader putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { AttributeBufferHeader attributeBufferHeader = (AttributeBufferHeader) o; return Objects.equals(this.name, attributeBufferHeader.name) && Objects.equals(this.fixedLenBufferSizeInBytes, attributeBufferHeader.fixedLenBufferSizeInBytes) && - Objects.equals(this.varLenBufferSizeInBytes, attributeBufferHeader.varLenBufferSizeInBytes)&& - Objects.equals(this.additionalProperties, attributeBufferHeader.additionalProperties); + Objects.equals(this.varLenBufferSizeInBytes, attributeBufferHeader.varLenBufferSizeInBytes); } @Override public int hashCode() { - return Objects.hash(name, fixedLenBufferSizeInBytes, varLenBufferSizeInBytes, additionalProperties); + return Objects.hash(name, fixedLenBufferSizeInBytes, varLenBufferSizeInBytes); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" fixedLenBufferSizeInBytes: ").append(toIndentedString(fixedLenBufferSizeInBytes)).append("\n"); sb.append(" varLenBufferSizeInBytes: ").append(toIndentedString(varLenBufferSizeInBytes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -225,28 +183,35 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("varLenBufferSizeInBytes"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AttributeBufferHeader - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AttributeBufferHeader.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 AttributeBufferHeader + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AttributeBufferHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in AttributeBufferHeader is not found in the empty JSON string", AttributeBufferHeader.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AttributeBufferHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AttributeBufferHeader` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AttributeBufferHeader.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -266,71 +231,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AttributeBufferHeader value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public AttributeBufferHeader read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - AttributeBufferHeader instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of AttributeBufferHeader given an JSON string - * - * @param jsonString JSON string - * @return An instance of AttributeBufferHeader - * @throws IOException if the JSON string is invalid with respect to AttributeBufferHeader - */ + /** + * Create an instance of AttributeBufferHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of AttributeBufferHeader + * @throws IOException if the JSON string is invalid with respect to AttributeBufferHeader + */ public static AttributeBufferHeader fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AttributeBufferHeader.class); } - /** - * Convert an instance of AttributeBufferHeader to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AttributeBufferHeader 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/model/AttributeBufferSize.java b/src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferSize.java index b6a06b2..1d1601e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferSize.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/AttributeBufferSize.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * object representing buffer size of an attribute */ -@ApiModel(description = "object representing buffer size of an attribute") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class AttributeBufferSize { public static final String SERIALIZED_NAME_ATTRIBUTE = "attribute"; @SerializedName(SERIALIZED_NAME_ATTRIBUTE) @@ -56,112 +63,65 @@ public class AttributeBufferSize { @SerializedName(SERIALIZED_NAME_DATA_BYTES) private Integer dataBytes; - public AttributeBufferSize() { + public AttributeBufferSize() { } public AttributeBufferSize attribute(String attribute) { - this.attribute = attribute; return this; } - /** + /** * name of attribute * @return attribute - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "name of attribute") - public String getAttribute() { return attribute; } - public void setAttribute(String attribute) { this.attribute = attribute; } public AttributeBufferSize offsetBytes(Integer offsetBytes) { - this.offsetBytes = offsetBytes; return this; } - /** + /** * buffer size (in bytes) of offset buffer * @return offsetBytes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "buffer size (in bytes) of offset buffer") - public Integer getOffsetBytes() { return offsetBytes; } - public void setOffsetBytes(Integer offsetBytes) { this.offsetBytes = offsetBytes; } public AttributeBufferSize dataBytes(Integer dataBytes) { - this.dataBytes = dataBytes; return this; } - /** + /** * buffer size (in bytes) of data buffer * @return dataBytes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "buffer size (in bytes) of data buffer") - public Integer getDataBytes() { return dataBytes; } - public void setDataBytes(Integer dataBytes) { this.dataBytes = dataBytes; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public AttributeBufferSize putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { AttributeBufferSize attributeBufferSize = (AttributeBufferSize) o; return Objects.equals(this.attribute, attributeBufferSize.attribute) && Objects.equals(this.offsetBytes, attributeBufferSize.offsetBytes) && - Objects.equals(this.dataBytes, attributeBufferSize.dataBytes)&& - Objects.equals(this.additionalProperties, attributeBufferSize.additionalProperties); + Objects.equals(this.dataBytes, attributeBufferSize.dataBytes); } @Override public int hashCode() { - return Objects.hash(attribute, offsetBytes, dataBytes, additionalProperties); + return Objects.hash(attribute, offsetBytes, dataBytes); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); sb.append(" offsetBytes: ").append(toIndentedString(offsetBytes)).append("\n"); sb.append(" dataBytes: ").append(toIndentedString(dataBytes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -225,28 +183,35 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("dataBytes"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AttributeBufferSize - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (AttributeBufferSize.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 AttributeBufferSize + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AttributeBufferSize.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in AttributeBufferSize is not found in the empty JSON string", AttributeBufferSize.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AttributeBufferSize.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AttributeBufferSize` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AttributeBufferSize.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("attribute") != null && !jsonObj.get("attribute").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("attribute").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `attribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute").toString())); } } @@ -266,71 +231,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AttributeBufferSize value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public AttributeBufferSize read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - AttributeBufferSize instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of AttributeBufferSize given an JSON string - * - * @param jsonString JSON string - * @return An instance of AttributeBufferSize - * @throws IOException if the JSON string is invalid with respect to AttributeBufferSize - */ + /** + * Create an instance of AttributeBufferSize given an JSON string + * + * @param jsonString JSON string + * @return An instance of AttributeBufferSize + * @throws IOException if the JSON string is invalid with respect to AttributeBufferSize + */ public static AttributeBufferSize fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AttributeBufferSize.class); } - /** - * Convert an instance of AttributeBufferSize to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AttributeBufferSize 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/model/Backoff.java b/src/main/java/io/tiledb/cloud/rest_api/model/Backoff.java index 5245100..e5849c7 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Backoff.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Backoff.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Backoff is a backoff strategy to use within retryStrategy */ -@ApiModel(description = "Backoff is a backoff strategy to use within retryStrategy") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Backoff { public static final String SERIALIZED_NAME_DURATION = "duration"; @SerializedName(SERIALIZED_NAME_DURATION) @@ -56,112 +63,65 @@ public class Backoff { @SerializedName(SERIALIZED_NAME_MAX_DURATION) private String maxDuration; - public Backoff() { + public Backoff() { } public Backoff duration(String duration) { - this.duration = duration; return this; } - /** + /** * Duration is the amount to back off. Default unit is seconds, but could also be a duration (e.g. \"2m\", \"1h\") * @return duration - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Duration is the amount to back off. Default unit is seconds, but could also be a duration (e.g. \"2m\", \"1h\")") - public String getDuration() { return duration; } - public void setDuration(String duration) { this.duration = duration; } public Backoff factor(Integer factor) { - this.factor = factor; return this; } - /** + /** * Factor is a factor to multiply the base duration after each failed retry * @return factor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Factor is a factor to multiply the base duration after each failed retry") - public Integer getFactor() { return factor; } - public void setFactor(Integer factor) { this.factor = factor; } public Backoff maxDuration(String maxDuration) { - this.maxDuration = maxDuration; return this; } - /** + /** * MaxDuration is the maximum amount of time allowed for the backoff strategy * @return maxDuration - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "MaxDuration is the maximum amount of time allowed for the backoff strategy") - public String getMaxDuration() { return maxDuration; } - public void setMaxDuration(String maxDuration) { this.maxDuration = maxDuration; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Backoff putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { Backoff backoff = (Backoff) o; return Objects.equals(this.duration, backoff.duration) && Objects.equals(this.factor, backoff.factor) && - Objects.equals(this.maxDuration, backoff.maxDuration)&& - Objects.equals(this.additionalProperties, backoff.additionalProperties); + Objects.equals(this.maxDuration, backoff.maxDuration); } @Override public int hashCode() { - return Objects.hash(duration, factor, maxDuration, additionalProperties); + return Objects.hash(duration, factor, maxDuration); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); sb.append(" factor: ").append(toIndentedString(factor)).append("\n"); sb.append(" maxDuration: ").append(toIndentedString(maxDuration)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,24 +180,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Backoff - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Backoff.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Backoff + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Backoff.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Backoff is not found in the empty JSON string", Backoff.openapiRequiredFields.toString())); } } - if (jsonObj.get("duration") != null && !jsonObj.get("duration").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Backoff.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Backoff` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("duration") != null && !jsonObj.get("duration").isJsonNull()) && !jsonObj.get("duration").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("duration").toString())); } - if (jsonObj.get("maxDuration") != null && !jsonObj.get("maxDuration").isJsonPrimitive()) { + if ((jsonObj.get("maxDuration") != null && !jsonObj.get("maxDuration").isJsonNull()) && !jsonObj.get("maxDuration").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `maxDuration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxDuration").toString())); } } @@ -259,71 +224,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Backoff value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Backoff read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Backoff instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Backoff given an JSON string - * - * @param jsonString JSON string - * @return An instance of Backoff - * @throws IOException if the JSON string is invalid with respect to Backoff - */ + /** + * Create an instance of Backoff given an JSON string + * + * @param jsonString JSON string + * @return An instance of Backoff + * @throws IOException if the JSON string is invalid with respect to Backoff + */ public static Backoff fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Backoff.class); } - /** - * Convert an instance of Backoff to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Backoff 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/model/ChangeAssetCredentialsRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequest.java index 9662597..b2340bd 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequest.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * Request body to change the credentials of the given assets */ -@ApiModel(description = "Request body to change the credentials of the given assets") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ChangeAssetCredentialsRequest { public static final String SERIALIZED_NAME_ACCESS_CREDENTIALS = "access_credentials"; @SerializedName(SERIALIZED_NAME_ACCESS_CREDENTIALS) @@ -54,94 +61,54 @@ public class ChangeAssetCredentialsRequest { @SerializedName(SERIALIZED_NAME_ASSET_UUIDS) private List assetUuids = new ArrayList<>(); - public ChangeAssetCredentialsRequest() { + public ChangeAssetCredentialsRequest() { } public ChangeAssetCredentialsRequest accessCredentials(String accessCredentials) { - this.accessCredentials = accessCredentials; return this; } - /** + /** * The name or uuid of the access credentials * @return accessCredentials - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name or uuid of the access credentials") - public String getAccessCredentials() { return accessCredentials; } - public void setAccessCredentials(String accessCredentials) { this.accessCredentials = accessCredentials; } public ChangeAssetCredentialsRequest assetUuids(List assetUuids) { - this.assetUuids = assetUuids; return this; } public ChangeAssetCredentialsRequest addAssetUuidsItem(String assetUuidsItem) { + if (this.assetUuids == null) { + this.assetUuids = new ArrayList<>(); + } this.assetUuids.add(assetUuidsItem); return this; } - /** + /** * The list of asset uuids to have their credentials changed * @return assetUuids - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of asset uuids to have their credentials changed") - public List getAssetUuids() { return assetUuids; } - public void setAssetUuids(List assetUuids) { this.assetUuids = assetUuids; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ChangeAssetCredentialsRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -154,13 +121,12 @@ public boolean equals(Object o) { } ChangeAssetCredentialsRequest changeAssetCredentialsRequest = (ChangeAssetCredentialsRequest) o; return Objects.equals(this.accessCredentials, changeAssetCredentialsRequest.accessCredentials) && - Objects.equals(this.assetUuids, changeAssetCredentialsRequest.assetUuids)&& - Objects.equals(this.additionalProperties, changeAssetCredentialsRequest.additionalProperties); + Objects.equals(this.assetUuids, changeAssetCredentialsRequest.assetUuids); } @Override public int hashCode() { - return Objects.hash(accessCredentials, assetUuids, additionalProperties); + return Objects.hash(accessCredentials, assetUuids); } @Override @@ -169,7 +135,6 @@ public String toString() { sb.append("class ChangeAssetCredentialsRequest {\n"); sb.append(" accessCredentials: ").append(toIndentedString(accessCredentials)).append("\n"); sb.append(" assetUuids: ").append(toIndentedString(assetUuids)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -201,32 +166,41 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("asset_uuids"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ChangeAssetCredentialsRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ChangeAssetCredentialsRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ChangeAssetCredentialsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChangeAssetCredentialsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ChangeAssetCredentialsRequest is not found in the empty JSON string", ChangeAssetCredentialsRequest.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ChangeAssetCredentialsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChangeAssetCredentialsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeAssetCredentialsRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("access_credentials") != null && !jsonObj.get("access_credentials").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("access_credentials").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `access_credentials` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_credentials").toString())); } - // ensure the json data is an array - if (jsonObj.get("asset_uuids") != null && !jsonObj.get("asset_uuids").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("asset_uuids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("asset_uuids").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `asset_uuids` to be an array in the JSON string but got `%s`", jsonObj.get("asset_uuids").toString())); } } @@ -246,71 +220,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ChangeAssetCredentialsRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ChangeAssetCredentialsRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ChangeAssetCredentialsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ChangeAssetCredentialsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ChangeAssetCredentialsRequest - * @throws IOException if the JSON string is invalid with respect to ChangeAssetCredentialsRequest - */ + /** + * Create an instance of ChangeAssetCredentialsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChangeAssetCredentialsRequest + * @throws IOException if the JSON string is invalid with respect to ChangeAssetCredentialsRequest + */ public static ChangeAssetCredentialsRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ChangeAssetCredentialsRequest.class); } - /** - * Convert an instance of ChangeAssetCredentialsRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ChangeAssetCredentialsRequest 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/model/Datatype.java b/src/main/java/io/tiledb/cloud/rest_api/model/Datatype.java index fc6510c..d42cf16 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Datatype.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Datatype.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -148,5 +149,10 @@ public Datatype read(final JsonReader jsonReader) throws IOException { return Datatype.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Datatype.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/Dimension.java b/src/main/java/io/tiledb/cloud/rest_api/model/Dimension.java index 6e7a368..bce6948 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Dimension.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Dimension.java @@ -14,26 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Datatype; +import io.tiledb.cloud.rest_api.model.DimensionTileExtent; +import io.tiledb.cloud.rest_api.model.DomainArray; +import io.tiledb.cloud.rest_api.model.FilterPipeline; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +53,7 @@ /** * Dimension of array */ -@ApiModel(description = "Dimension of array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Dimension { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -68,181 +79,122 @@ public class Dimension { @SerializedName(SERIALIZED_NAME_FILTER_PIPELINE) private FilterPipeline filterPipeline; - public Dimension() { + public Dimension() { } public Dimension name(String name) { - this.name = name; return this; } - /** + /** * Dimension name * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "row", value = "Dimension name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public Dimension type(Datatype type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Datatype getType() { return type; } - public void setType(Datatype type) { this.type = type; } public Dimension domain(DomainArray domain) { - this.domain = domain; return this; } - /** + /** * Get domain * @return domain - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public DomainArray getDomain() { return domain; } - public void setDomain(DomainArray domain) { this.domain = domain; } public Dimension nullTileExtent(Boolean nullTileExtent) { - this.nullTileExtent = nullTileExtent; return this; } - /** + /** * Is tile extent null * @return nullTileExtent - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "true", required = true, value = "Is tile extent null") - public Boolean getNullTileExtent() { return nullTileExtent; } - public void setNullTileExtent(Boolean nullTileExtent) { this.nullTileExtent = nullTileExtent; } public Dimension tileExtent(DimensionTileExtent tileExtent) { - this.tileExtent = tileExtent; return this; } - /** + /** * Get tileExtent * @return tileExtent - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DimensionTileExtent getTileExtent() { return tileExtent; } - public void setTileExtent(DimensionTileExtent tileExtent) { this.tileExtent = tileExtent; } public Dimension filterPipeline(FilterPipeline filterPipeline) { - this.filterPipeline = filterPipeline; return this; } - /** + /** * Get filterPipeline * @return filterPipeline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public FilterPipeline getFilterPipeline() { return filterPipeline; } - public void setFilterPipeline(FilterPipeline filterPipeline) { this.filterPipeline = filterPipeline; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Dimension putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -259,13 +211,12 @@ public boolean equals(Object o) { Objects.equals(this.domain, dimension.domain) && Objects.equals(this.nullTileExtent, dimension.nullTileExtent) && Objects.equals(this.tileExtent, dimension.tileExtent) && - Objects.equals(this.filterPipeline, dimension.filterPipeline)&& - Objects.equals(this.additionalProperties, dimension.additionalProperties); + Objects.equals(this.filterPipeline, dimension.filterPipeline); } @Override public int hashCode() { - return Objects.hash(name, type, domain, nullTileExtent, tileExtent, filterPipeline, additionalProperties); + return Objects.hash(name, type, domain, nullTileExtent, tileExtent, filterPipeline); } @Override @@ -278,7 +229,6 @@ public String toString() { sb.append(" nullTileExtent: ").append(toIndentedString(nullTileExtent)).append("\n"); sb.append(" tileExtent: ").append(toIndentedString(tileExtent)).append("\n"); sb.append(" filterPipeline: ").append(toIndentedString(filterPipeline)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -315,41 +265,48 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("nullTileExtent"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Dimension - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Dimension.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Dimension + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Dimension.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Dimension is not found in the empty JSON string", Dimension.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Dimension.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dimension` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Dimension.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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 `domain` - if (jsonObj.getAsJsonObject("domain") != null) { - DomainArray.validateJsonObject(jsonObj.getAsJsonObject("domain")); - } + // validate the required field `type` + Datatype.validateJsonElement(jsonObj.get("type")); + // validate the required field `domain` + DomainArray.validateJsonElement(jsonObj.get("domain")); // validate the optional field `tileExtent` - if (jsonObj.getAsJsonObject("tileExtent") != null) { - DimensionTileExtent.validateJsonObject(jsonObj.getAsJsonObject("tileExtent")); + if (jsonObj.get("tileExtent") != null && !jsonObj.get("tileExtent").isJsonNull()) { + DimensionTileExtent.validateJsonElement(jsonObj.get("tileExtent")); } // validate the optional field `filterPipeline` - if (jsonObj.getAsJsonObject("filterPipeline") != null) { - FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("filterPipeline")); + if (jsonObj.get("filterPipeline") != null && !jsonObj.get("filterPipeline").isJsonNull()) { + FilterPipeline.validateJsonElement(jsonObj.get("filterPipeline")); } } @@ -368,71 +325,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Dimension value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Dimension read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Dimension instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Dimension given an JSON string - * - * @param jsonString JSON string - * @return An instance of Dimension - * @throws IOException if the JSON string is invalid with respect to Dimension - */ + /** + * Create an instance of Dimension given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dimension + * @throws IOException if the JSON string is invalid with respect to Dimension + */ public static Dimension fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Dimension.class); } - /** - * Convert an instance of Dimension to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Dimension 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/model/DimensionCoordinate.java b/src/main/java/io/tiledb/cloud/rest_api/model/DimensionCoordinate.java index e67abc8..c473787 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/DimensionCoordinate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/DimensionCoordinate.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * A single, typed coordinate for a dimension */ -@ApiModel(description = "A single, typed coordinate for a dimension") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DimensionCoordinate { public static final String SERIALIZED_NAME_INT8 = "int8"; @SerializedName(SERIALIZED_NAME_INT8) @@ -84,273 +91,198 @@ public class DimensionCoordinate { @SerializedName(SERIALIZED_NAME_FLOAT64) private Double float64; - public DimensionCoordinate() { + public DimensionCoordinate() { } public DimensionCoordinate int8(Integer int8) { - this.int8 = int8; return this; } - /** + /** * Get int8 * @return int8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt8() { return int8; } - public void setInt8(Integer int8) { this.int8 = int8; } public DimensionCoordinate uint8(Integer uint8) { - this.uint8 = uint8; return this; } - /** + /** * Get uint8 * @return uint8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint8() { return uint8; } - public void setUint8(Integer uint8) { this.uint8 = uint8; } public DimensionCoordinate int16(Integer int16) { - this.int16 = int16; return this; } - /** + /** * Get int16 * @return int16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt16() { return int16; } - public void setInt16(Integer int16) { this.int16 = int16; } public DimensionCoordinate uint16(Integer uint16) { - this.uint16 = uint16; return this; } - /** + /** * Get uint16 * @return uint16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint16() { return uint16; } - public void setUint16(Integer uint16) { this.uint16 = uint16; } public DimensionCoordinate int32(Integer int32) { - this.int32 = int32; return this; } - /** + /** * Get int32 * @return int32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } public DimensionCoordinate uint32(Integer uint32) { - this.uint32 = uint32; return this; } - /** + /** * Get uint32 * @return uint32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint32() { return uint32; } - public void setUint32(Integer uint32) { this.uint32 = uint32; } public DimensionCoordinate int64(Long int64) { - this.int64 = int64; return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } public DimensionCoordinate uint64(Integer uint64) { - this.uint64 = uint64; return this; } - /** + /** * Get uint64 * @return uint64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint64() { return uint64; } - public void setUint64(Integer uint64) { this.uint64 = uint64; } public DimensionCoordinate float32(Float float32) { - this.float32 = float32; return this; } - /** + /** * Get float32 * @return float32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Float getFloat32() { return float32; } - public void setFloat32(Float float32) { this.float32 = float32; } public DimensionCoordinate float64(Double float64) { - this.float64 = float64; return this; } - /** + /** * Get float64 * @return float64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Double getFloat64() { return float64; } - public void setFloat64(Double float64) { this.float64 = float64; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public DimensionCoordinate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -371,13 +303,12 @@ public boolean equals(Object o) { Objects.equals(this.int64, dimensionCoordinate.int64) && Objects.equals(this.uint64, dimensionCoordinate.uint64) && Objects.equals(this.float32, dimensionCoordinate.float32) && - Objects.equals(this.float64, dimensionCoordinate.float64)&& - Objects.equals(this.additionalProperties, dimensionCoordinate.additionalProperties); + Objects.equals(this.float64, dimensionCoordinate.float64); } @Override public int hashCode() { - return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64); } @Override @@ -394,7 +325,6 @@ public String toString() { sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -432,20 +362,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DimensionCoordinate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (DimensionCoordinate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 DimensionCoordinate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DimensionCoordinate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in DimensionCoordinate is not found in the empty JSON string", DimensionCoordinate.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DimensionCoordinate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DimensionCoordinate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -463,71 +400,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DimensionCoordinate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public DimensionCoordinate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - DimensionCoordinate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of DimensionCoordinate given an JSON string - * - * @param jsonString JSON string - * @return An instance of DimensionCoordinate - * @throws IOException if the JSON string is invalid with respect to DimensionCoordinate - */ + /** + * Create an instance of DimensionCoordinate given an JSON string + * + * @param jsonString JSON string + * @return An instance of DimensionCoordinate + * @throws IOException if the JSON string is invalid with respect to DimensionCoordinate + */ public static DimensionCoordinate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DimensionCoordinate.class); } - /** - * Convert an instance of DimensionCoordinate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DimensionCoordinate 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/model/DimensionTileExtent.java b/src/main/java/io/tiledb/cloud/rest_api/model/DimensionTileExtent.java index 50246fb..4875f99 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/DimensionTileExtent.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/DimensionTileExtent.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Extent of tile */ -@ApiModel(description = "Extent of tile") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DimensionTileExtent { public static final String SERIALIZED_NAME_INT8 = "int8"; @SerializedName(SERIALIZED_NAME_INT8) @@ -84,273 +91,198 @@ public class DimensionTileExtent { @SerializedName(SERIALIZED_NAME_FLOAT64) private Integer float64; - public DimensionTileExtent() { + public DimensionTileExtent() { } public DimensionTileExtent int8(Integer int8) { - this.int8 = int8; return this; } - /** + /** * Get int8 * @return int8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt8() { return int8; } - public void setInt8(Integer int8) { this.int8 = int8; } public DimensionTileExtent uint8(Integer uint8) { - this.uint8 = uint8; return this; } - /** + /** * Get uint8 * @return uint8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint8() { return uint8; } - public void setUint8(Integer uint8) { this.uint8 = uint8; } public DimensionTileExtent int16(Integer int16) { - this.int16 = int16; return this; } - /** + /** * Get int16 * @return int16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt16() { return int16; } - public void setInt16(Integer int16) { this.int16 = int16; } public DimensionTileExtent uint16(Integer uint16) { - this.uint16 = uint16; return this; } - /** + /** * Get uint16 * @return uint16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint16() { return uint16; } - public void setUint16(Integer uint16) { this.uint16 = uint16; } public DimensionTileExtent int32(Integer int32) { - this.int32 = int32; return this; } - /** + /** * Get int32 * @return int32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } public DimensionTileExtent uint32(Integer uint32) { - this.uint32 = uint32; return this; } - /** + /** * Get uint32 * @return uint32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint32() { return uint32; } - public void setUint32(Integer uint32) { this.uint32 = uint32; } public DimensionTileExtent int64(Long int64) { - this.int64 = int64; return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } public DimensionTileExtent uint64(Integer uint64) { - this.uint64 = uint64; return this; } - /** + /** * Get uint64 * @return uint64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint64() { return uint64; } - public void setUint64(Integer uint64) { this.uint64 = uint64; } public DimensionTileExtent float32(Integer float32) { - this.float32 = float32; return this; } - /** + /** * Get float32 * @return float32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getFloat32() { return float32; } - public void setFloat32(Integer float32) { this.float32 = float32; } public DimensionTileExtent float64(Integer float64) { - this.float64 = float64; return this; } - /** + /** * Get float64 * @return float64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getFloat64() { return float64; } - public void setFloat64(Integer float64) { this.float64 = float64; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public DimensionTileExtent putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -371,13 +303,12 @@ public boolean equals(Object o) { Objects.equals(this.int64, dimensionTileExtent.int64) && Objects.equals(this.uint64, dimensionTileExtent.uint64) && Objects.equals(this.float32, dimensionTileExtent.float32) && - Objects.equals(this.float64, dimensionTileExtent.float64)&& - Objects.equals(this.additionalProperties, dimensionTileExtent.additionalProperties); + Objects.equals(this.float64, dimensionTileExtent.float64); } @Override public int hashCode() { - return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64); } @Override @@ -394,7 +325,6 @@ public String toString() { sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -432,20 +362,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DimensionTileExtent - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (DimensionTileExtent.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 DimensionTileExtent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DimensionTileExtent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in DimensionTileExtent is not found in the empty JSON string", DimensionTileExtent.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DimensionTileExtent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DimensionTileExtent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -463,71 +400,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DimensionTileExtent value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public DimensionTileExtent read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - DimensionTileExtent instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of DimensionTileExtent given an JSON string - * - * @param jsonString JSON string - * @return An instance of DimensionTileExtent - * @throws IOException if the JSON string is invalid with respect to DimensionTileExtent - */ + /** + * Create an instance of DimensionTileExtent given an JSON string + * + * @param jsonString JSON string + * @return An instance of DimensionTileExtent + * @throws IOException if the JSON string is invalid with respect to DimensionTileExtent + */ public static DimensionTileExtent fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DimensionTileExtent.class); } - /** - * Convert an instance of DimensionTileExtent to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DimensionTileExtent 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/model/Domain.java b/src/main/java/io/tiledb/cloud/rest_api/model/Domain.java index 2f00f05..6e7c4bb 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Domain.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Domain.java @@ -14,37 +14,47 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Datatype; +import io.tiledb.cloud.rest_api.model.Dimension; +import io.tiledb.cloud.rest_api.model.Layout; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Domain of array */ -@ApiModel(description = "Domain of array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Domain { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -62,140 +72,92 @@ public class Domain { @SerializedName(SERIALIZED_NAME_DIMENSIONS) private List dimensions = new ArrayList<>(); - public Domain() { + public Domain() { } public Domain type(Datatype type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Datatype getType() { return type; } - public void setType(Datatype type) { this.type = type; } public Domain tileOrder(Layout tileOrder) { - this.tileOrder = tileOrder; return this; } - /** + /** * Get tileOrder * @return tileOrder - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Layout getTileOrder() { return tileOrder; } - public void setTileOrder(Layout tileOrder) { this.tileOrder = tileOrder; } public Domain cellOrder(Layout cellOrder) { - this.cellOrder = cellOrder; return this; } - /** + /** * Get cellOrder * @return cellOrder - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Layout getCellOrder() { return cellOrder; } - public void setCellOrder(Layout cellOrder) { this.cellOrder = cellOrder; } public Domain dimensions(List dimensions) { - this.dimensions = dimensions; return this; } public Domain addDimensionsItem(Dimension dimensionsItem) { + if (this.dimensions == null) { + this.dimensions = new ArrayList<>(); + } this.dimensions.add(dimensionsItem); return this; } - /** + /** * Array of dimensions * @return dimensions - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array of dimensions") - public List getDimensions() { return dimensions; } - public void setDimensions(List dimensions) { this.dimensions = dimensions; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Domain putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -210,13 +172,12 @@ public boolean equals(Object o) { return Objects.equals(this.type, domain.type) && Objects.equals(this.tileOrder, domain.tileOrder) && Objects.equals(this.cellOrder, domain.cellOrder) && - Objects.equals(this.dimensions, domain.dimensions)&& - Objects.equals(this.additionalProperties, domain.additionalProperties); + Objects.equals(this.dimensions, domain.dimensions); } @Override public int hashCode() { - return Objects.hash(type, tileOrder, cellOrder, dimensions, additionalProperties); + return Objects.hash(type, tileOrder, cellOrder, dimensions); } @Override @@ -227,7 +188,6 @@ public String toString() { sb.append(" tileOrder: ").append(toIndentedString(tileOrder)).append("\n"); sb.append(" cellOrder: ").append(toIndentedString(cellOrder)).append("\n"); sb.append(" dimensions: ").append(toIndentedString(dimensions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -263,39 +223,50 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("dimensions"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Domain - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Domain.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Domain + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Domain.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Domain is not found in the empty JSON string", Domain.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Domain.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Domain` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Domain.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - JsonArray jsonArraydimensions = jsonObj.getAsJsonArray("dimensions"); - if (jsonArraydimensions != null) { - // ensure the json data is an array - if (!jsonObj.get("dimensions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `dimensions` to be an array in the JSON string but got `%s`", jsonObj.get("dimensions").toString())); - } - - // validate the optional field `dimensions` (array) - for (int i = 0; i < jsonArraydimensions.size(); i++) { - Dimension.validateJsonObject(jsonArraydimensions.get(i).getAsJsonObject()); - }; + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `type` + Datatype.validateJsonElement(jsonObj.get("type")); + // validate the required field `tileOrder` + Layout.validateJsonElement(jsonObj.get("tileOrder")); + // validate the required field `cellOrder` + Layout.validateJsonElement(jsonObj.get("cellOrder")); + // ensure the json data is an array + if (!jsonObj.get("dimensions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `dimensions` to be an array in the JSON string but got `%s`", jsonObj.get("dimensions").toString())); } + + JsonArray jsonArraydimensions = jsonObj.getAsJsonArray("dimensions"); + // validate the required field `dimensions` (array) + for (int i = 0; i < jsonArraydimensions.size(); i++) { + Dimension.validateJsonElement(jsonArraydimensions.get(i)); + }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -313,71 +284,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Domain value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Domain read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Domain instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Domain given an JSON string - * - * @param jsonString JSON string - * @return An instance of Domain - * @throws IOException if the JSON string is invalid with respect to Domain - */ + /** + * Create an instance of Domain given an JSON string + * + * @param jsonString JSON string + * @return An instance of Domain + * @throws IOException if the JSON string is invalid with respect to Domain + */ public static Domain fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Domain.class); } - /** - * Convert an instance of Domain to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Domain 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/model/DomainArray.java b/src/main/java/io/tiledb/cloud/rest_api/model/DomainArray.java index 647ca3c..5756bac 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/DomainArray.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/DomainArray.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,54 +51,52 @@ /** * Domain object for an array of each type */ -@ApiModel(description = "Domain object for an array of each type") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DomainArray { public static final String SERIALIZED_NAME_INT8 = "int8"; @SerializedName(SERIALIZED_NAME_INT8) - private List int8 = null; + private List int8 = new ArrayList<>(); public static final String SERIALIZED_NAME_UINT8 = "uint8"; @SerializedName(SERIALIZED_NAME_UINT8) - private List uint8 = null; + private List uint8 = new ArrayList<>(); public static final String SERIALIZED_NAME_INT16 = "int16"; @SerializedName(SERIALIZED_NAME_INT16) - private List int16 = null; + private List int16 = new ArrayList<>(); public static final String SERIALIZED_NAME_UINT16 = "uint16"; @SerializedName(SERIALIZED_NAME_UINT16) - private List uint16 = null; + private List uint16 = new ArrayList<>(); public static final String SERIALIZED_NAME_INT32 = "int32"; @SerializedName(SERIALIZED_NAME_INT32) - private List int32 = null; + private List int32 = new ArrayList<>(); public static final String SERIALIZED_NAME_UINT32 = "uint32"; @SerializedName(SERIALIZED_NAME_UINT32) - private List uint32 = null; + private List uint32 = new ArrayList<>(); public static final String SERIALIZED_NAME_INT64 = "int64"; @SerializedName(SERIALIZED_NAME_INT64) - private List int64 = null; + private List int64 = new ArrayList<>(); public static final String SERIALIZED_NAME_UINT64 = "uint64"; @SerializedName(SERIALIZED_NAME_UINT64) - private List uint64 = null; + private List uint64 = new ArrayList<>(); public static final String SERIALIZED_NAME_FLOAT32 = "float32"; @SerializedName(SERIALIZED_NAME_FLOAT32) - private List float32 = null; + private List float32 = new ArrayList<>(); public static final String SERIALIZED_NAME_FLOAT64 = "float64"; @SerializedName(SERIALIZED_NAME_FLOAT64) - private List float64 = null; + private List float64 = new ArrayList<>(); - public DomainArray() { + public DomainArray() { } public DomainArray int8(List int8) { - this.int8 = int8; return this; } @@ -103,25 +109,21 @@ public DomainArray addInt8Item(Integer int8Item) { return this; } - /** + /** * Get int8 * @return int8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getInt8() { return int8; } - public void setInt8(List int8) { this.int8 = int8; } public DomainArray uint8(List uint8) { - this.uint8 = uint8; return this; } @@ -134,25 +136,21 @@ public DomainArray addUint8Item(Integer uint8Item) { return this; } - /** + /** * Get uint8 * @return uint8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getUint8() { return uint8; } - public void setUint8(List uint8) { this.uint8 = uint8; } public DomainArray int16(List int16) { - this.int16 = int16; return this; } @@ -165,25 +163,21 @@ public DomainArray addInt16Item(Integer int16Item) { return this; } - /** + /** * Get int16 * @return int16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getInt16() { return int16; } - public void setInt16(List int16) { this.int16 = int16; } public DomainArray uint16(List uint16) { - this.uint16 = uint16; return this; } @@ -196,25 +190,21 @@ public DomainArray addUint16Item(Integer uint16Item) { return this; } - /** + /** * Get uint16 * @return uint16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getUint16() { return uint16; } - public void setUint16(List uint16) { this.uint16 = uint16; } public DomainArray int32(List int32) { - this.int32 = int32; return this; } @@ -227,25 +217,21 @@ public DomainArray addInt32Item(Integer int32Item) { return this; } - /** + /** * Get int32 * @return int32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getInt32() { return int32; } - public void setInt32(List int32) { this.int32 = int32; } public DomainArray uint32(List uint32) { - this.uint32 = uint32; return this; } @@ -258,25 +244,21 @@ public DomainArray addUint32Item(Integer uint32Item) { return this; } - /** + /** * Get uint32 * @return uint32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getUint32() { return uint32; } - public void setUint32(List uint32) { this.uint32 = uint32; } public DomainArray int64(List int64) { - this.int64 = int64; return this; } @@ -289,25 +271,21 @@ public DomainArray addInt64Item(Long int64Item) { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getInt64() { return int64; } - public void setInt64(List int64) { this.int64 = int64; } public DomainArray uint64(List uint64) { - this.uint64 = uint64; return this; } @@ -320,25 +298,21 @@ public DomainArray addUint64Item(Integer uint64Item) { return this; } - /** + /** * Get uint64 * @return uint64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getUint64() { return uint64; } - public void setUint64(List uint64) { this.uint64 = uint64; } public DomainArray float32(List float32) { - this.float32 = float32; return this; } @@ -351,25 +325,21 @@ public DomainArray addFloat32Item(Float float32Item) { return this; } - /** + /** * Get float32 * @return float32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getFloat32() { return float32; } - public void setFloat32(List float32) { this.float32 = float32; } public DomainArray float64(List float64) { - this.float64 = float64; return this; } @@ -382,57 +352,19 @@ public DomainArray addFloat64Item(Double float64Item) { return this; } - /** + /** * Get float64 * @return float64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getFloat64() { return float64; } - public void setFloat64(List float64) { this.float64 = float64; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public DomainArray putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -453,13 +385,12 @@ public boolean equals(Object o) { Objects.equals(this.int64, domainArray.int64) && Objects.equals(this.uint64, domainArray.uint64) && Objects.equals(this.float32, domainArray.float32) && - Objects.equals(this.float64, domainArray.float64)&& - Objects.equals(this.additionalProperties, domainArray.additionalProperties); + Objects.equals(this.float64, domainArray.float64); } @Override public int hashCode() { - return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64); } @Override @@ -476,7 +407,6 @@ public String toString() { sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -514,58 +444,65 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DomainArray - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (DomainArray.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 DomainArray + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DomainArray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in DomainArray is not found in the empty JSON string", DomainArray.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("int8") != null && !jsonObj.get("int8").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DomainArray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DomainArray` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("int8") != null && !jsonObj.get("int8").isJsonNull() && !jsonObj.get("int8").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `int8` to be an array in the JSON string but got `%s`", jsonObj.get("int8").toString())); } - // ensure the json data is an array - if (jsonObj.get("uint8") != null && !jsonObj.get("uint8").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("uint8") != null && !jsonObj.get("uint8").isJsonNull() && !jsonObj.get("uint8").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `uint8` to be an array in the JSON string but got `%s`", jsonObj.get("uint8").toString())); } - // ensure the json data is an array - if (jsonObj.get("int16") != null && !jsonObj.get("int16").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("int16") != null && !jsonObj.get("int16").isJsonNull() && !jsonObj.get("int16").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `int16` to be an array in the JSON string but got `%s`", jsonObj.get("int16").toString())); } - // ensure the json data is an array - if (jsonObj.get("uint16") != null && !jsonObj.get("uint16").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("uint16") != null && !jsonObj.get("uint16").isJsonNull() && !jsonObj.get("uint16").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `uint16` to be an array in the JSON string but got `%s`", jsonObj.get("uint16").toString())); } - // ensure the json data is an array - if (jsonObj.get("int32") != null && !jsonObj.get("int32").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("int32") != null && !jsonObj.get("int32").isJsonNull() && !jsonObj.get("int32").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `int32` to be an array in the JSON string but got `%s`", jsonObj.get("int32").toString())); } - // ensure the json data is an array - if (jsonObj.get("uint32") != null && !jsonObj.get("uint32").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("uint32") != null && !jsonObj.get("uint32").isJsonNull() && !jsonObj.get("uint32").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `uint32` to be an array in the JSON string but got `%s`", jsonObj.get("uint32").toString())); } - // ensure the json data is an array - if (jsonObj.get("int64") != null && !jsonObj.get("int64").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("int64") != null && !jsonObj.get("int64").isJsonNull() && !jsonObj.get("int64").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `int64` to be an array in the JSON string but got `%s`", jsonObj.get("int64").toString())); } - // ensure the json data is an array - if (jsonObj.get("uint64") != null && !jsonObj.get("uint64").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("uint64") != null && !jsonObj.get("uint64").isJsonNull() && !jsonObj.get("uint64").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `uint64` to be an array in the JSON string but got `%s`", jsonObj.get("uint64").toString())); } - // ensure the json data is an array - if (jsonObj.get("float32") != null && !jsonObj.get("float32").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("float32") != null && !jsonObj.get("float32").isJsonNull() && !jsonObj.get("float32").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `float32` to be an array in the JSON string but got `%s`", jsonObj.get("float32").toString())); } - // ensure the json data is an array - if (jsonObj.get("float64") != null && !jsonObj.get("float64").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("float64") != null && !jsonObj.get("float64").isJsonNull() && !jsonObj.get("float64").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `float64` to be an array in the JSON string but got `%s`", jsonObj.get("float64").toString())); } } @@ -585,71 +522,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DomainArray value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public DomainArray read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - DomainArray instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of DomainArray given an JSON string - * - * @param jsonString JSON string - * @return An instance of DomainArray - * @throws IOException if the JSON string is invalid with respect to DomainArray - */ + /** + * Create an instance of DomainArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of DomainArray + * @throws IOException if the JSON string is invalid with respect to DomainArray + */ public static DomainArray fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DomainArray.class); } - /** - * Convert an instance of DomainArray to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DomainArray 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/model/DomainCheckResult.java b/src/main/java/io/tiledb/cloud/rest_api/model/DomainCheckResult.java index 2aed4ec..caaeeab 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/DomainCheckResult.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/DomainCheckResult.java @@ -14,35 +14,44 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.DomainCheckStatus; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * The record of a check of a single domain's status. */ -@ApiModel(description = "The record of a check of a single domain's status.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DomainCheckResult { public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) @@ -52,89 +61,46 @@ public class DomainCheckResult { @SerializedName(SERIALIZED_NAME_STATUS) private DomainCheckStatus status; - public DomainCheckResult() { + public DomainCheckResult() { } public DomainCheckResult time(OffsetDateTime time) { - this.time = time; return this; } - /** + /** * The timestamp when the check was performed. * @return time - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The timestamp when the check was performed.") - public OffsetDateTime getTime() { return time; } - public void setTime(OffsetDateTime time) { this.time = time; } public DomainCheckResult status(DomainCheckStatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DomainCheckStatus getStatus() { return status; } - public void setStatus(DomainCheckStatus status) { this.status = status; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public DomainCheckResult putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -147,13 +113,12 @@ public boolean equals(Object o) { } DomainCheckResult domainCheckResult = (DomainCheckResult) o; return Objects.equals(this.time, domainCheckResult.time) && - Objects.equals(this.status, domainCheckResult.status)&& - Objects.equals(this.additionalProperties, domainCheckResult.additionalProperties); + Objects.equals(this.status, domainCheckResult.status); } @Override public int hashCode() { - return Objects.hash(time, status, additionalProperties); + return Objects.hash(time, status); } @Override @@ -162,7 +127,6 @@ public String toString() { sb.append("class DomainCheckResult {\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,20 +156,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DomainCheckResult - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (DomainCheckResult.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 DomainCheckResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DomainCheckResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in DomainCheckResult is not found in the empty JSON string", DomainCheckResult.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DomainCheckResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DomainCheckResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + DomainCheckStatus.validateJsonElement(jsonObj.get("status")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -223,71 +198,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DomainCheckResult value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public DomainCheckResult read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - DomainCheckResult instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of DomainCheckResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of DomainCheckResult - * @throws IOException if the JSON string is invalid with respect to DomainCheckResult - */ + /** + * Create an instance of DomainCheckResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of DomainCheckResult + * @throws IOException if the JSON string is invalid with respect to DomainCheckResult + */ public static DomainCheckResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DomainCheckResult.class); } - /** - * Convert an instance of DomainCheckResult to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DomainCheckResult 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/model/DomainCheckStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/DomainCheckStatus.java index 49077e7..0e333d7 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/DomainCheckStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/DomainCheckStatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public DomainCheckStatus read(final JsonReader jsonReader) throws IOException { return DomainCheckStatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DomainCheckStatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatus.java index 51a0303..d55f65a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -72,5 +73,10 @@ public DomainVerificationStatus read(final JsonReader jsonReader) throws IOExcep return DomainVerificationStatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DomainVerificationStatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/Enumeration.java b/src/main/java/io/tiledb/cloud/rest_api/model/Enumeration.java index 690b41b..7ebbd2f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Enumeration.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Enumeration.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * The enumerations of a single attribute */ -@ApiModel(description = "The enumerations of a single attribute") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Enumeration { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -68,132 +75,111 @@ public class Enumeration { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private List data = null; + private List data = new ArrayList<>(); public static final String SERIALIZED_NAME_OFFSETS = "offsets"; @SerializedName(SERIALIZED_NAME_OFFSETS) - private List offsets = null; + private List offsets = new ArrayList<>(); - public Enumeration() { + public Enumeration() { } public Enumeration name(String name) { - this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public Enumeration pathName(String pathName) { - this.pathName = pathName; return this; } - /** + /** * Get pathName * @return pathName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getPathName() { return pathName; } - public void setPathName(String pathName) { this.pathName = pathName; } public Enumeration type(String type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getType() { return type; } - public void setType(String type) { this.type = type; } public Enumeration cellValNum(Integer cellValNum) { - this.cellValNum = cellValNum; return this; } - /** + /** * Get cellValNum * @return cellValNum - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getCellValNum() { return cellValNum; } - public void setCellValNum(Integer cellValNum) { this.cellValNum = cellValNum; } public Enumeration ordered(Boolean ordered) { - this.ordered = ordered; return this; } - /** + /** * Get ordered * @return ordered - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getOrdered() { return ordered; } - public void setOrdered(Boolean ordered) { this.ordered = ordered; } public Enumeration data(List data) { - this.data = data; return this; } @@ -206,25 +192,21 @@ public Enumeration addDataItem(Integer dataItem) { return this; } - /** + /** * Get data * @return data - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getData() { return data; } - public void setData(List data) { this.data = data; } public Enumeration offsets(List offsets) { - this.offsets = offsets; return this; } @@ -237,57 +219,19 @@ public Enumeration addOffsetsItem(Integer offsetsItem) { return this; } - /** + /** * Get offsets * @return offsets - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getOffsets() { return offsets; } - public void setOffsets(List offsets) { this.offsets = offsets; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Enumeration putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -305,13 +249,12 @@ public boolean equals(Object o) { Objects.equals(this.cellValNum, enumeration.cellValNum) && Objects.equals(this.ordered, enumeration.ordered) && Objects.equals(this.data, enumeration.data) && - Objects.equals(this.offsets, enumeration.offsets)&& - Objects.equals(this.additionalProperties, enumeration.additionalProperties); + Objects.equals(this.offsets, enumeration.offsets); } @Override public int hashCode() { - return Objects.hash(name, pathName, type, cellValNum, ordered, data, offsets, additionalProperties); + return Objects.hash(name, pathName, type, cellValNum, ordered, data, offsets); } @Override @@ -325,7 +268,6 @@ public String toString() { sb.append(" ordered: ").append(toIndentedString(ordered)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" offsets: ").append(toIndentedString(offsets)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -360,35 +302,42 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Enumeration - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Enumeration.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Enumeration + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Enumeration.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Enumeration is not found in the empty JSON string", Enumeration.openapiRequiredFields.toString())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Enumeration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Enumeration` 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_name") != null && !jsonObj.get("path_name").isJsonPrimitive()) { + if ((jsonObj.get("path_name") != null && !jsonObj.get("path_name").isJsonNull()) && !jsonObj.get("path_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path_name").toString())); } - if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !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("data") != null && !jsonObj.get("data").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull() && !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())); } - // ensure the json data is an array - if (jsonObj.get("offsets") != null && !jsonObj.get("offsets").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("offsets") != null && !jsonObj.get("offsets").isJsonNull() && !jsonObj.get("offsets").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `offsets` to be an array in the JSON string but got `%s`", jsonObj.get("offsets").toString())); } } @@ -408,71 +357,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Enumeration value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Enumeration read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Enumeration instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Enumeration given an JSON string - * - * @param jsonString JSON string - * @return An instance of Enumeration - * @throws IOException if the JSON string is invalid with respect to Enumeration - */ + /** + * Create an instance of Enumeration given an JSON string + * + * @param jsonString JSON string + * @return An instance of Enumeration + * @throws IOException if the JSON string is invalid with respect to Enumeration + */ public static Enumeration fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Enumeration.class); } - /** - * Convert an instance of Enumeration to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Enumeration 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/model/Error.java b/src/main/java/io/tiledb/cloud/rest_api/model/Error.java index 7790a0e..e76f388 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Error.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Error.java @@ -14,32 +14,42 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Error */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Error { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) @@ -53,112 +63,65 @@ public class Error { @SerializedName(SERIALIZED_NAME_REQUEST_ID) private String requestId; - public Error() { + public Error() { } public Error code(Long code) { - this.code = code; return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Long getCode() { return code; } - public void setCode(Long code) { this.code = code; } public Error message(String message) { - this.message = message; return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public Error requestId(String requestId) { - this.requestId = requestId; return this; } - /** + /** * Get requestId * @return requestId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getRequestId() { return requestId; } - public void setRequestId(String requestId) { this.requestId = requestId; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Error putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -172,13 +135,12 @@ public boolean equals(Object o) { 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.additionalProperties, error.additionalProperties); + Objects.equals(this.requestId, error.requestId); } @Override public int hashCode() { - return Objects.hash(code, message, requestId, additionalProperties); + return Objects.hash(code, message, requestId); } @Override @@ -188,7 +150,6 @@ public String toString() { 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -219,24 +180,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Error - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Error.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); } } - if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { + + 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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !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") != null && !jsonObj.get("request_id").isJsonPrimitive()) { + if ((jsonObj.get("request_id") != null && !jsonObj.get("request_id").isJsonNull()) && !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())); } } @@ -256,71 +224,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Error value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Error read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Error instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/FileCreate.java b/src/main/java/io/tiledb/cloud/rest_api/model/FileCreate.java index 7bc44c6..768bedb 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FileCreate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FileCreate.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Input/Output information required to create a new file */ -@ApiModel(description = "Input/Output information required to create a new file") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FileCreate { public static final String SERIALIZED_NAME_INPUT_URI = "input_uri"; @SerializedName(SERIALIZED_NAME_INPUT_URI) @@ -56,112 +63,65 @@ public class FileCreate { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public FileCreate() { + public FileCreate() { } public FileCreate inputUri(String inputUri) { - this.inputUri = inputUri; return this; } - /** + /** * storage URI of the input file * @return inputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "storage URI of the input file") - public String getInputUri() { return inputUri; } - public void setInputUri(String inputUri) { this.inputUri = inputUri; } public FileCreate outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB File * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB File") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public FileCreate name(String name) { - this.name = name; return this; } - /** + /** * name to set for registered file * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name to set for registered file") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FileCreate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { FileCreate fileCreate = (FileCreate) o; return Objects.equals(this.inputUri, fileCreate.inputUri) && Objects.equals(this.outputUri, fileCreate.outputUri) && - Objects.equals(this.name, fileCreate.name)&& - Objects.equals(this.additionalProperties, fileCreate.additionalProperties); + Objects.equals(this.name, fileCreate.name); } @Override public int hashCode() { - return Objects.hash(inputUri, outputUri, name, additionalProperties); + return Objects.hash(inputUri, outputUri, name); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" inputUri: ").append(toIndentedString(inputUri)).append("\n"); sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FileCreate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FileCreate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FileCreate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileCreate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FileCreate is not found in the empty JSON string", FileCreate.openapiRequiredFields.toString())); } } - if (jsonObj.get("input_uri") != null && !jsonObj.get("input_uri").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileCreate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileCreate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("input_uri") != null && !jsonObj.get("input_uri").isJsonNull()) && !jsonObj.get("input_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `input_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input_uri").toString())); } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FileCreate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FileCreate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FileCreate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FileCreate given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileCreate - * @throws IOException if the JSON string is invalid with respect to FileCreate - */ + /** + * Create an instance of FileCreate given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileCreate + * @throws IOException if the JSON string is invalid with respect to FileCreate + */ public static FileCreate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileCreate.class); } - /** - * Convert an instance of FileCreate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileCreate 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/model/FileCreated.java b/src/main/java/io/tiledb/cloud/rest_api/model/FileCreated.java index 301a222..e39396f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FileCreated.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FileCreated.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Created file name and information */ -@ApiModel(description = "Created file name and information") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FileCreated { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) @@ -52,89 +59,46 @@ public class FileCreated { @SerializedName(SERIALIZED_NAME_FILE_NAME) private String fileName; - public FileCreated() { + public FileCreated() { } public FileCreated outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB File * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB File") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public FileCreated fileName(String fileName) { - this.fileName = fileName; return this; } - /** + /** * name of the file created * @return fileName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of the file created") - public String getFileName() { return fileName; } - public void setFileName(String fileName) { this.fileName = fileName; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FileCreated putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -147,13 +111,12 @@ public boolean equals(Object o) { } FileCreated fileCreated = (FileCreated) o; return Objects.equals(this.outputUri, fileCreated.outputUri) && - Objects.equals(this.fileName, fileCreated.fileName)&& - Objects.equals(this.additionalProperties, fileCreated.additionalProperties); + Objects.equals(this.fileName, fileCreated.fileName); } @Override public int hashCode() { - return Objects.hash(outputUri, fileName, additionalProperties); + return Objects.hash(outputUri, fileName); } @Override @@ -162,7 +125,6 @@ public String toString() { sb.append("class FileCreated {\n"); sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,24 +154,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FileCreated - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FileCreated.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FileCreated + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileCreated.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FileCreated is not found in the empty JSON string", FileCreated.openapiRequiredFields.toString())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileCreated.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileCreated` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("file_name") != null && !jsonObj.get("file_name").isJsonPrimitive()) { + if ((jsonObj.get("file_name") != null && !jsonObj.get("file_name").isJsonNull()) && !jsonObj.get("file_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `file_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_name").toString())); } } @@ -229,71 +198,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FileCreated value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FileCreated read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FileCreated instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FileCreated given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileCreated - * @throws IOException if the JSON string is invalid with respect to FileCreated - */ + /** + * Create an instance of FileCreated given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileCreated + * @throws IOException if the JSON string is invalid with respect to FileCreated + */ public static FileCreated fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileCreated.class); } - /** - * Convert an instance of FileCreated to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileCreated 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/model/FileExport.java b/src/main/java/io/tiledb/cloud/rest_api/model/FileExport.java index eb7d9b4..360966b 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FileExport.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FileExport.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,73 +49,33 @@ /** * Output information required to export a file */ -@ApiModel(description = "Output information required to export a file") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FileExport { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) private String outputUri; - public FileExport() { + public FileExport() { } public FileExport outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB File * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB File") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FileExport putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -119,13 +87,12 @@ public boolean equals(Object o) { return false; } FileExport fileExport = (FileExport) o; - return Objects.equals(this.outputUri, fileExport.outputUri)&& - Objects.equals(this.additionalProperties, fileExport.additionalProperties); + return Objects.equals(this.outputUri, fileExport.outputUri); } @Override public int hashCode() { - return Objects.hash(outputUri, additionalProperties); + return Objects.hash(outputUri); } @Override @@ -133,7 +100,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FileExport {\n"); sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -162,21 +128,28 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FileExport - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FileExport.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FileExport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileExport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FileExport is not found in the empty JSON string", FileExport.openapiRequiredFields.toString())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileExport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileExport` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } } @@ -196,71 +169,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FileExport value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FileExport read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FileExport instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FileExport given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileExport - * @throws IOException if the JSON string is invalid with respect to FileExport - */ + /** + * Create an instance of FileExport given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileExport + * @throws IOException if the JSON string is invalid with respect to FileExport + */ public static FileExport fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileExport.class); } - /** - * Convert an instance of FileExport to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileExport 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/model/FileExported.java b/src/main/java/io/tiledb/cloud/rest_api/model/FileExported.java index e541456..907bb22 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FileExported.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FileExported.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,73 +49,33 @@ /** * Output uri of the exported file */ -@ApiModel(description = "Output uri of the exported file") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FileExported { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) private String outputUri; - public FileExported() { + public FileExported() { } public FileExported outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the exported file * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the exported file") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FileExported putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -119,13 +87,12 @@ public boolean equals(Object o) { return false; } FileExported fileExported = (FileExported) o; - return Objects.equals(this.outputUri, fileExported.outputUri)&& - Objects.equals(this.additionalProperties, fileExported.additionalProperties); + return Objects.equals(this.outputUri, fileExported.outputUri); } @Override public int hashCode() { - return Objects.hash(outputUri, additionalProperties); + return Objects.hash(outputUri); } @Override @@ -133,7 +100,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FileExported {\n"); sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -162,21 +128,28 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FileExported - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FileExported.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FileExported + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileExported.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FileExported is not found in the empty JSON string", FileExported.openapiRequiredFields.toString())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileExported.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileExported` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } } @@ -196,71 +169,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FileExported value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FileExported read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FileExported instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FileExported given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileExported - * @throws IOException if the JSON string is invalid with respect to FileExported - */ + /** + * Create an instance of FileExported given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileExported + * @throws IOException if the JSON string is invalid with respect to FileExported + */ public static FileExported fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileExported.class); } - /** - * Convert an instance of FileExported to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileExported 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/model/FilePropertyName.java b/src/main/java/io/tiledb/cloud/rest_api/model/FilePropertyName.java index 820e407..3146600 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FilePropertyName.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FilePropertyName.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -78,5 +79,10 @@ public FilePropertyName read(final JsonReader jsonReader) throws IOException { return FilePropertyName.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FilePropertyName.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/FileType.java b/src/main/java/io/tiledb/cloud/rest_api/model/FileType.java index dcc27e4..48619e3 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FileType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FileType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -74,5 +75,10 @@ public FileType read(final JsonReader jsonReader) throws IOException { return FileType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FileType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/FileUploaded.java b/src/main/java/io/tiledb/cloud/rest_api/model/FileUploaded.java index 7760eae..1a36432 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FileUploaded.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FileUploaded.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Uploaded file name and information */ -@ApiModel(description = "Uploaded file name and information") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FileUploaded { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) @@ -60,135 +67,84 @@ public class FileUploaded { @SerializedName(SERIALIZED_NAME_ID) private String id; - public FileUploaded() { + public FileUploaded() { } public FileUploaded outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB File * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB File") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public FileUploaded fileName(String fileName) { - this.fileName = fileName; return this; } - /** + /** * name of the file uploaded * @return fileName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of the file uploaded") - public String getFileName() { return fileName; } - public void setFileName(String fileName) { this.fileName = fileName; } public FileUploaded assetId(String assetId) { - this.assetId = assetId; return this; } - /** + /** * The asset id of the created Group * @return assetId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The asset id of the created Group") - public String getAssetId() { return assetId; } - public void setAssetId(String assetId) { this.assetId = assetId; } public FileUploaded id(String id) { - this.id = id; return this; } - /** + /** * unique ID of the uploaded file * @return id - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "unique ID of the uploaded file") - public String getId() { return id; } - public void setId(String id) { this.id = id; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FileUploaded putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +159,12 @@ public boolean equals(Object o) { return Objects.equals(this.outputUri, fileUploaded.outputUri) && Objects.equals(this.fileName, fileUploaded.fileName) && Objects.equals(this.assetId, fileUploaded.assetId) && - Objects.equals(this.id, fileUploaded.id)&& - Objects.equals(this.additionalProperties, fileUploaded.additionalProperties); + Objects.equals(this.id, fileUploaded.id); } @Override public int hashCode() { - return Objects.hash(outputUri, fileName, assetId, id, additionalProperties); + return Objects.hash(outputUri, fileName, assetId, id); } @Override @@ -220,7 +175,6 @@ public String toString() { sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -254,37 +208,44 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FileUploaded - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FileUploaded.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FileUploaded + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FileUploaded.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FileUploaded is not found in the empty JSON string", FileUploaded.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FileUploaded.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileUploaded` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : FileUploaded.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("file_name") != null && !jsonObj.get("file_name").isJsonPrimitive()) { + if ((jsonObj.get("file_name") != null && !jsonObj.get("file_name").isJsonNull()) && !jsonObj.get("file_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `file_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_name").toString())); } - if (jsonObj.get("asset_id") != null && !jsonObj.get("asset_id").isJsonPrimitive()) { + 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("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + 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())); } } @@ -304,71 +265,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FileUploaded value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FileUploaded read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FileUploaded instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FileUploaded given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileUploaded - * @throws IOException if the JSON string is invalid with respect to FileUploaded - */ + /** + * Create an instance of FileUploaded given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileUploaded + * @throws IOException if the JSON string is invalid with respect to FileUploaded + */ public static FileUploaded fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileUploaded.class); } - /** - * Convert an instance of FileUploaded to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileUploaded 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/model/Filter.java b/src/main/java/io/tiledb/cloud/rest_api/model/Filter.java index 8a774e5..e941c0f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Filter.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Filter.java @@ -14,34 +14,44 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.FilterData; +import io.tiledb.cloud.rest_api.model.FilterType; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Filter */ -@ApiModel(description = "Filter") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Filter { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -51,89 +61,46 @@ public class Filter { @SerializedName(SERIALIZED_NAME_DATA) private FilterData data; - public Filter() { + public Filter() { } public Filter type(FilterType type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public FilterType getType() { return type; } - public void setType(FilterType type) { this.type = type; } public Filter data(FilterData data) { - this.data = data; return this; } - /** + /** * Get data * @return data - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public FilterData getData() { return data; } - public void setData(FilterData data) { this.data = data; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Filter putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -146,13 +113,12 @@ public boolean equals(Object o) { } Filter filter = (Filter) o; return Objects.equals(this.type, filter.type) && - Objects.equals(this.data, filter.data)&& - Objects.equals(this.additionalProperties, filter.additionalProperties); + Objects.equals(this.data, filter.data); } @Override public int hashCode() { - return Objects.hash(type, data, additionalProperties); + return Objects.hash(type, data); } @Override @@ -161,7 +127,6 @@ public String toString() { sb.append("class Filter {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,30 +157,39 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("type"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Filter.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Filter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Filter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Filter is not found in the empty JSON string", Filter.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Filter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Filter` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Filter.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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 `type` + FilterType.validateJsonElement(jsonObj.get("type")); // validate the optional field `data` - if (jsonObj.getAsJsonObject("data") != null) { - FilterData.validateJsonObject(jsonObj.getAsJsonObject("data")); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + FilterData.validateJsonElement(jsonObj.get("data")); } } @@ -234,71 +208,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Filter value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Filter read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Filter instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Filter given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter - * @throws IOException if the JSON string is invalid with respect to Filter - */ + /** + * Create an instance of Filter given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter + * @throws IOException if the JSON string is invalid with respect to Filter + */ public static Filter fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Filter.class); } - /** - * Convert an instance of Filter to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Filter 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/model/FilterData.java b/src/main/java/io/tiledb/cloud/rest_api/model/FilterData.java index da0563a..a9cac90 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FilterData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FilterData.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Filter data */ -@ApiModel(description = "Filter data") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FilterData { public static final String SERIALIZED_NAME_INT8 = "int8"; @SerializedName(SERIALIZED_NAME_INT8) @@ -84,273 +91,198 @@ public class FilterData { @SerializedName(SERIALIZED_NAME_FLOAT64) private Integer float64; - public FilterData() { + public FilterData() { } public FilterData int8(Integer int8) { - this.int8 = int8; return this; } - /** + /** * Get int8 * @return int8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt8() { return int8; } - public void setInt8(Integer int8) { this.int8 = int8; } public FilterData uint8(Integer uint8) { - this.uint8 = uint8; return this; } - /** + /** * Get uint8 * @return uint8 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint8() { return uint8; } - public void setUint8(Integer uint8) { this.uint8 = uint8; } public FilterData int16(Integer int16) { - this.int16 = int16; return this; } - /** + /** * Get int16 * @return int16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt16() { return int16; } - public void setInt16(Integer int16) { this.int16 = int16; } public FilterData uint16(Integer uint16) { - this.uint16 = uint16; return this; } - /** + /** * Get uint16 * @return uint16 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint16() { return uint16; } - public void setUint16(Integer uint16) { this.uint16 = uint16; } public FilterData int32(Integer int32) { - this.int32 = int32; return this; } - /** + /** * Get int32 * @return int32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } public FilterData uint32(Integer uint32) { - this.uint32 = uint32; return this; } - /** + /** * Get uint32 * @return uint32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint32() { return uint32; } - public void setUint32(Integer uint32) { this.uint32 = uint32; } public FilterData int64(Long int64) { - this.int64 = int64; return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } public FilterData uint64(Integer uint64) { - this.uint64 = uint64; return this; } - /** + /** * Get uint64 * @return uint64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getUint64() { return uint64; } - public void setUint64(Integer uint64) { this.uint64 = uint64; } public FilterData float32(Integer float32) { - this.float32 = float32; return this; } - /** + /** * Get float32 * @return float32 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getFloat32() { return float32; } - public void setFloat32(Integer float32) { this.float32 = float32; } public FilterData float64(Integer float64) { - this.float64 = float64; return this; } - /** + /** * Get float64 * @return float64 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getFloat64() { return float64; } - public void setFloat64(Integer float64) { this.float64 = float64; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FilterData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -371,13 +303,12 @@ public boolean equals(Object o) { Objects.equals(this.int64, filterData.int64) && Objects.equals(this.uint64, filterData.uint64) && Objects.equals(this.float32, filterData.float32) && - Objects.equals(this.float64, filterData.float64)&& - Objects.equals(this.additionalProperties, filterData.additionalProperties); + Objects.equals(this.float64, filterData.float64); } @Override public int hashCode() { - return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64); } @Override @@ -394,7 +325,6 @@ public String toString() { sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -432,20 +362,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FilterData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FilterData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FilterData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FilterData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FilterData is not found in the empty JSON string", FilterData.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FilterData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FilterData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -463,71 +400,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FilterData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FilterData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FilterData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FilterData given an JSON string - * - * @param jsonString JSON string - * @return An instance of FilterData - * @throws IOException if the JSON string is invalid with respect to FilterData - */ + /** + * Create an instance of FilterData given an JSON string + * + * @param jsonString JSON string + * @return An instance of FilterData + * @throws IOException if the JSON string is invalid with respect to FilterData + */ public static FilterData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FilterData.class); } - /** - * Convert an instance of FilterData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FilterData 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/model/FilterOption.java b/src/main/java/io/tiledb/cloud/rest_api/model/FilterOption.java index 0a9a4ed..f84c0a5 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FilterOption.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FilterOption.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public FilterOption read(final JsonReader jsonReader) throws IOException { return FilterOption.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FilterOption.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/FilterPipeline.java b/src/main/java/io/tiledb/cloud/rest_api/model/FilterPipeline.java index d3e268d..639b2a4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FilterPipeline.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FilterPipeline.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Filter; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,18 +52,16 @@ /** * One or more filters to apply */ -@ApiModel(description = "One or more filters to apply") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FilterPipeline { public static final String SERIALIZED_NAME_FILTERS = "filters"; @SerializedName(SERIALIZED_NAME_FILTERS) - private List filters = null; + private List filters = new ArrayList<>(); - public FilterPipeline() { + public FilterPipeline() { } public FilterPipeline filters(List filters) { - this.filters = filters; return this; } @@ -68,57 +74,19 @@ public FilterPipeline addFiltersItem(Filter filtersItem) { return this; } - /** + /** * Get filters * @return filters - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getFilters() { return filters; } - public void setFilters(List filters) { this.filters = filters; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FilterPipeline putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -130,13 +98,12 @@ public boolean equals(Object o) { return false; } FilterPipeline filterPipeline = (FilterPipeline) o; - return Objects.equals(this.filters, filterPipeline.filters)&& - Objects.equals(this.additionalProperties, filterPipeline.additionalProperties); + return Objects.equals(this.filters, filterPipeline.filters); } @Override public int hashCode() { - return Objects.hash(filters, additionalProperties); + return Objects.hash(filters); } @Override @@ -144,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FilterPipeline {\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -173,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FilterPipeline - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FilterPipeline.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FilterPipeline + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FilterPipeline.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FilterPipeline is not found in the empty JSON string", FilterPipeline.openapiRequiredFields.toString())); } } - JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); - if (jsonArrayfilters != null) { - // ensure the json data is an array - if (!jsonObj.get("filters").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `filters` to be an array in the JSON string but got `%s`", jsonObj.get("filters").toString())); - } - // validate the optional field `filters` (array) - for (int i = 0; i < jsonArrayfilters.size(); i++) { - Filter.validateJsonObject(jsonArrayfilters.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FilterPipeline.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FilterPipeline` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); + if (jsonArrayfilters != null) { + // ensure the json data is an array + if (!jsonObj.get("filters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `filters` to be an array in the JSON string but got `%s`", jsonObj.get("filters").toString())); + } + + // validate the optional field `filters` (array) + for (int i = 0; i < jsonArrayfilters.size(); i++) { + Filter.validateJsonElement(jsonArrayfilters.get(i)); + }; + } } } @@ -216,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FilterPipeline value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FilterPipeline read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FilterPipeline instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FilterPipeline given an JSON string - * - * @param jsonString JSON string - * @return An instance of FilterPipeline - * @throws IOException if the JSON string is invalid with respect to FilterPipeline - */ + /** + * Create an instance of FilterPipeline given an JSON string + * + * @param jsonString JSON string + * @return An instance of FilterPipeline + * @throws IOException if the JSON string is invalid with respect to FilterPipeline + */ public static FilterPipeline fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FilterPipeline.class); } - /** - * Convert an instance of FilterPipeline to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FilterPipeline 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/model/FilterType.java b/src/main/java/io/tiledb/cloud/rest_api/model/FilterType.java index 49bc540..f9225fc 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FilterType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FilterType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -86,5 +87,10 @@ public FilterType read(final JsonReader jsonReader) throws IOException { return FilterType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FilterType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfo.java b/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfo.java index cb4f0bd..87f4d84 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfo.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfo.java @@ -14,29 +14,40 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArraySchema; +import io.tiledb.cloud.rest_api.model.SingleFragmentInfo; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,26 +55,24 @@ /** * Fragment info of an array */ -@ApiModel(description = "Fragment info of an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FragmentInfo { public static final String SERIALIZED_NAME_ARRAY_SCHEMA_ALL = "arraySchemaAll"; @SerializedName(SERIALIZED_NAME_ARRAY_SCHEMA_ALL) - private Map arraySchemaAll = null; + private Map arraySchemaAll = new HashMap<>(); public static final String SERIALIZED_NAME_FRAGMENT_INFO = "fragmentInfo"; @SerializedName(SERIALIZED_NAME_FRAGMENT_INFO) - private List fragmentInfo = null; + private List fragmentInfo = new ArrayList<>(); public static final String SERIALIZED_NAME_TO_VACUUM = "toVacuum"; @SerializedName(SERIALIZED_NAME_TO_VACUUM) - private List toVacuum = null; + private List toVacuum = new ArrayList<>(); - public FragmentInfo() { + public FragmentInfo() { } public FragmentInfo arraySchemaAll(Map arraySchemaAll) { - this.arraySchemaAll = arraySchemaAll; return this; } @@ -76,25 +85,21 @@ public FragmentInfo putArraySchemaAllItem(String key, ArraySchema arraySchemaAll return this; } - /** + /** * map of all array schemas * @return arraySchemaAll - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "map of all array schemas") - public Map getArraySchemaAll() { return arraySchemaAll; } - public void setArraySchemaAll(Map arraySchemaAll) { this.arraySchemaAll = arraySchemaAll; } public FragmentInfo fragmentInfo(List fragmentInfo) { - this.fragmentInfo = fragmentInfo; return this; } @@ -107,25 +112,21 @@ public FragmentInfo addFragmentInfoItem(SingleFragmentInfo fragmentInfoItem) { return this; } - /** + /** * information about fragments in the array * @return fragmentInfo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "information about fragments in the array") - public List getFragmentInfo() { return fragmentInfo; } - public void setFragmentInfo(List fragmentInfo) { this.fragmentInfo = fragmentInfo; } public FragmentInfo toVacuum(List toVacuum) { - this.toVacuum = toVacuum; return this; } @@ -138,57 +139,19 @@ public FragmentInfo addToVacuumItem(String toVacuumItem) { return this; } - /** + /** * the URIs of the fragments to vacuum * @return toVacuum - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the URIs of the fragments to vacuum") - public List getToVacuum() { return toVacuum; } - public void setToVacuum(List toVacuum) { this.toVacuum = toVacuum; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FragmentInfo putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -202,13 +165,12 @@ public boolean equals(Object o) { FragmentInfo fragmentInfo = (FragmentInfo) o; return Objects.equals(this.arraySchemaAll, fragmentInfo.arraySchemaAll) && Objects.equals(this.fragmentInfo, fragmentInfo.fragmentInfo) && - Objects.equals(this.toVacuum, fragmentInfo.toVacuum)&& - Objects.equals(this.additionalProperties, fragmentInfo.additionalProperties); + Objects.equals(this.toVacuum, fragmentInfo.toVacuum); } @Override public int hashCode() { - return Objects.hash(arraySchemaAll, fragmentInfo, toVacuum, additionalProperties); + return Objects.hash(arraySchemaAll, fragmentInfo, toVacuum); } @Override @@ -218,7 +180,6 @@ public String toString() { sb.append(" arraySchemaAll: ").append(toIndentedString(arraySchemaAll)).append("\n"); sb.append(" fragmentInfo: ").append(toIndentedString(fragmentInfo)).append("\n"); sb.append(" toVacuum: ").append(toIndentedString(toVacuum)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -249,34 +210,43 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FragmentInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FragmentInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FragmentInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FragmentInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FragmentInfo is not found in the empty JSON string", FragmentInfo.openapiRequiredFields.toString())); } } - JsonArray jsonArrayfragmentInfo = jsonObj.getAsJsonArray("fragmentInfo"); - if (jsonArrayfragmentInfo != null) { - // ensure the json data is an array - if (!jsonObj.get("fragmentInfo").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `fragmentInfo` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentInfo").toString())); - } - // validate the optional field `fragmentInfo` (array) - for (int i = 0; i < jsonArrayfragmentInfo.size(); i++) { - SingleFragmentInfo.validateJsonObject(jsonArrayfragmentInfo.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FragmentInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FragmentInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } } - // ensure the json data is an array - if (jsonObj.get("toVacuum") != null && !jsonObj.get("toVacuum").isJsonArray()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("fragmentInfo") != null && !jsonObj.get("fragmentInfo").isJsonNull()) { + JsonArray jsonArrayfragmentInfo = jsonObj.getAsJsonArray("fragmentInfo"); + if (jsonArrayfragmentInfo != null) { + // ensure the json data is an array + if (!jsonObj.get("fragmentInfo").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentInfo` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentInfo").toString())); + } + + // validate the optional field `fragmentInfo` (array) + for (int i = 0; i < jsonArrayfragmentInfo.size(); i++) { + SingleFragmentInfo.validateJsonElement(jsonArrayfragmentInfo.get(i)); + }; + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("toVacuum") != null && !jsonObj.get("toVacuum").isJsonNull() && !jsonObj.get("toVacuum").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `toVacuum` to be an array in the JSON string but got `%s`", jsonObj.get("toVacuum").toString())); } } @@ -296,71 +266,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FragmentInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FragmentInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FragmentInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FragmentInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of FragmentInfo - * @throws IOException if the JSON string is invalid with respect to FragmentInfo - */ + /** + * Create an instance of FragmentInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of FragmentInfo + * @throws IOException if the JSON string is invalid with respect to FragmentInfo + */ public static FragmentInfo fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FragmentInfo.class); } - /** - * Convert an instance of FragmentInfo to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FragmentInfo 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/model/FragmentInfoRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequest.java index 9c89829..630cd6d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequest.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TileDBConfig; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,73 +50,33 @@ /** * Fragment info request */ -@ApiModel(description = "Fragment info request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FragmentInfoRequest { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) private TileDBConfig config; - public FragmentInfoRequest() { + public FragmentInfoRequest() { } public FragmentInfoRequest config(TileDBConfig config) { - this.config = config; return this; } - /** + /** * Get config * @return config - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TileDBConfig getConfig() { return config; } - public void setConfig(TileDBConfig config) { this.config = config; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FragmentInfoRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -119,13 +88,12 @@ public boolean equals(Object o) { return false; } FragmentInfoRequest fragmentInfoRequest = (FragmentInfoRequest) o; - return Objects.equals(this.config, fragmentInfoRequest.config)&& - Objects.equals(this.additionalProperties, fragmentInfoRequest.additionalProperties); + return Objects.equals(this.config, fragmentInfoRequest.config); } @Override public int hashCode() { - return Objects.hash(config, additionalProperties); + return Objects.hash(config); } @Override @@ -133,7 +101,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FragmentInfoRequest {\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -162,23 +129,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FragmentInfoRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FragmentInfoRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FragmentInfoRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FragmentInfoRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FragmentInfoRequest is not found in the empty JSON string", FragmentInfoRequest.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FragmentInfoRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FragmentInfoRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `config` - if (jsonObj.getAsJsonObject("config") != null) { - TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + TileDBConfig.validateJsonElement(jsonObj.get("config")); } } @@ -197,71 +171,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FragmentInfoRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FragmentInfoRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FragmentInfoRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FragmentInfoRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of FragmentInfoRequest - * @throws IOException if the JSON string is invalid with respect to FragmentInfoRequest - */ + /** + * Create an instance of FragmentInfoRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FragmentInfoRequest + * @throws IOException if the JSON string is invalid with respect to FragmentInfoRequest + */ public static FragmentInfoRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FragmentInfoRequest.class); } - /** - * Convert an instance of FragmentInfoRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FragmentInfoRequest 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/model/FragmentMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/model/FragmentMetadata.java index 237b163..40a9740 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/FragmentMetadata.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/FragmentMetadata.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,20 +51,19 @@ /** * Fragment Metadata */ -@ApiModel(description = "Fragment Metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class FragmentMetadata { public static final String SERIALIZED_NAME_FILE_SIZES = "fileSizes"; @SerializedName(SERIALIZED_NAME_FILE_SIZES) - private List fileSizes = null; + private List fileSizes = new ArrayList<>(); public static final String SERIALIZED_NAME_FILE_VAR_SIZES = "fileVarSizes"; @SerializedName(SERIALIZED_NAME_FILE_VAR_SIZES) - private List fileVarSizes = null; + private List fileVarSizes = new ArrayList<>(); public static final String SERIALIZED_NAME_FILE_VALIDITY_SIZES = "fileValiditySizes"; @SerializedName(SERIALIZED_NAME_FILE_VALIDITY_SIZES) - private List fileValiditySizes = null; + private List fileValiditySizes = new ArrayList<>(); public static final String SERIALIZED_NAME_FRAGMENT_URI = "fragmentUri"; @SerializedName(SERIALIZED_NAME_FRAGMENT_URI) @@ -80,59 +87,59 @@ public class FragmentMetadata { public static final String SERIALIZED_NAME_TILE_OFFSETS = "tileOffsets"; @SerializedName(SERIALIZED_NAME_TILE_OFFSETS) - private List> tileOffsets = null; + private List> tileOffsets = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_VAR_OFFSETS = "tileVarOffsets"; @SerializedName(SERIALIZED_NAME_TILE_VAR_OFFSETS) - private List> tileVarOffsets = null; + private List> tileVarOffsets = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_VAR_SIZES = "tileVarSizes"; @SerializedName(SERIALIZED_NAME_TILE_VAR_SIZES) - private List> tileVarSizes = null; + private List> tileVarSizes = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_VALIDITY_OFFSETS = "tileValidityOffsets"; @SerializedName(SERIALIZED_NAME_TILE_VALIDITY_OFFSETS) - private List> tileValidityOffsets = null; + private List> tileValidityOffsets = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_MIN_BUFFER = "tileMinBuffer"; @SerializedName(SERIALIZED_NAME_TILE_MIN_BUFFER) - private List> tileMinBuffer = null; + private List> tileMinBuffer = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_MIN_VAR_BUFFER = "tileMinVarBuffer"; @SerializedName(SERIALIZED_NAME_TILE_MIN_VAR_BUFFER) - private List> tileMinVarBuffer = null; + private List> tileMinVarBuffer = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_MAX_BUFFER = "tileMaxBuffer"; @SerializedName(SERIALIZED_NAME_TILE_MAX_BUFFER) - private List> tileMaxBuffer = null; + private List> tileMaxBuffer = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_MAX_VAR_BUFFER = "tileMaxVarBuffer"; @SerializedName(SERIALIZED_NAME_TILE_MAX_VAR_BUFFER) - private List> tileMaxVarBuffer = null; + private List> tileMaxVarBuffer = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_SUMS = "tileSums"; @SerializedName(SERIALIZED_NAME_TILE_SUMS) - private List> tileSums = null; + private List> tileSums = new ArrayList<>(); public static final String SERIALIZED_NAME_TILE_NULL_COUNTS = "tileNullCounts"; @SerializedName(SERIALIZED_NAME_TILE_NULL_COUNTS) - private List> tileNullCounts = null; + private List> tileNullCounts = new ArrayList<>(); public static final String SERIALIZED_NAME_FRAGMENT_MINS = "fragmentMins"; @SerializedName(SERIALIZED_NAME_FRAGMENT_MINS) - private List> fragmentMins = null; + private List> fragmentMins = new ArrayList<>(); public static final String SERIALIZED_NAME_FRAGMENT_MAXS = "fragmentMaxs"; @SerializedName(SERIALIZED_NAME_FRAGMENT_MAXS) - private List> fragmentMaxs = null; + private List> fragmentMaxs = new ArrayList<>(); public static final String SERIALIZED_NAME_FRAGMENT_SUMS = "fragmentSums"; @SerializedName(SERIALIZED_NAME_FRAGMENT_SUMS) - private List fragmentSums = null; + private List fragmentSums = new ArrayList<>(); public static final String SERIALIZED_NAME_FRAGMENT_NULL_COUNTS = "fragmentNullCounts"; @SerializedName(SERIALIZED_NAME_FRAGMENT_NULL_COUNTS) - private List fragmentNullCounts = null; + private List fragmentNullCounts = new ArrayList<>(); public static final String SERIALIZED_NAME_VERSION = "version"; @SerializedName(SERIALIZED_NAME_VERSION) @@ -140,17 +147,16 @@ public class FragmentMetadata { public static final String SERIALIZED_NAME_TIMESTAMP_RANGE = "timestampRange"; @SerializedName(SERIALIZED_NAME_TIMESTAMP_RANGE) - private List timestampRange = null; + private List timestampRange = new ArrayList<>(); public static final String SERIALIZED_NAME_LAST_TILE_CELL_NUM = "lastTileCellNum"; @SerializedName(SERIALIZED_NAME_LAST_TILE_CELL_NUM) private Integer lastTileCellNum; - public FragmentMetadata() { + public FragmentMetadata() { } public FragmentMetadata fileSizes(List fileSizes) { - this.fileSizes = fileSizes; return this; } @@ -163,25 +169,21 @@ public FragmentMetadata addFileSizesItem(Integer fileSizesItem) { return this; } - /** + /** * fixed sizes * @return fileSizes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "fixed sizes") - public List getFileSizes() { return fileSizes; } - public void setFileSizes(List fileSizes) { this.fileSizes = fileSizes; } public FragmentMetadata fileVarSizes(List fileVarSizes) { - this.fileVarSizes = fileVarSizes; return this; } @@ -194,25 +196,21 @@ public FragmentMetadata addFileVarSizesItem(Integer fileVarSizesItem) { return this; } - /** + /** * var length sizes * @return fileVarSizes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "var length sizes") - public List getFileVarSizes() { return fileVarSizes; } - public void setFileVarSizes(List fileVarSizes) { this.fileVarSizes = fileVarSizes; } public FragmentMetadata fileValiditySizes(List fileValiditySizes) { - this.fileValiditySizes = fileValiditySizes; return this; } @@ -225,140 +223,116 @@ public FragmentMetadata addFileValiditySizesItem(Integer fileValiditySizesItem) return this; } - /** + /** * validity sizes * @return fileValiditySizes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "validity sizes") - public List getFileValiditySizes() { return fileValiditySizes; } - public void setFileValiditySizes(List fileValiditySizes) { this.fileValiditySizes = fileValiditySizes; } public FragmentMetadata fragmentUri(String fragmentUri) { - this.fragmentUri = fragmentUri; return this; } - /** + /** * Get fragmentUri * @return fragmentUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getFragmentUri() { return fragmentUri; } - public void setFragmentUri(String fragmentUri) { this.fragmentUri = fragmentUri; } public FragmentMetadata hasTimestamps(Boolean hasTimestamps) { - this.hasTimestamps = hasTimestamps; return this; } - /** + /** * Get hasTimestamps * @return hasTimestamps - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getHasTimestamps() { return hasTimestamps; } - public void setHasTimestamps(Boolean hasTimestamps) { this.hasTimestamps = hasTimestamps; } public FragmentMetadata hasDeleteMeta(Boolean hasDeleteMeta) { - this.hasDeleteMeta = hasDeleteMeta; return this; } - /** + /** * Get hasDeleteMeta * @return hasDeleteMeta - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getHasDeleteMeta() { return hasDeleteMeta; } - public void setHasDeleteMeta(Boolean hasDeleteMeta) { this.hasDeleteMeta = hasDeleteMeta; } public FragmentMetadata sparseTileNum(Integer sparseTileNum) { - this.sparseTileNum = sparseTileNum; return this; } - /** + /** * Get sparseTileNum * @return sparseTileNum - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getSparseTileNum() { return sparseTileNum; } - public void setSparseTileNum(Integer sparseTileNum) { this.sparseTileNum = sparseTileNum; } public FragmentMetadata tileIndexBase(Integer tileIndexBase) { - this.tileIndexBase = tileIndexBase; return this; } - /** + /** * Get tileIndexBase * @return tileIndexBase - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getTileIndexBase() { return tileIndexBase; } - public void setTileIndexBase(Integer tileIndexBase) { this.tileIndexBase = tileIndexBase; } public FragmentMetadata tileOffsets(List> tileOffsets) { - this.tileOffsets = tileOffsets; return this; } @@ -371,25 +345,21 @@ public FragmentMetadata addTileOffsetsItem(List tileOffsetsItem) { return this; } - /** + /** * Get tileOffsets * @return tileOffsets - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileOffsets() { return tileOffsets; } - public void setTileOffsets(List> tileOffsets) { this.tileOffsets = tileOffsets; } public FragmentMetadata tileVarOffsets(List> tileVarOffsets) { - this.tileVarOffsets = tileVarOffsets; return this; } @@ -402,25 +372,21 @@ public FragmentMetadata addTileVarOffsetsItem(List tileVarOffsetsItem) return this; } - /** + /** * Get tileVarOffsets * @return tileVarOffsets - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileVarOffsets() { return tileVarOffsets; } - public void setTileVarOffsets(List> tileVarOffsets) { this.tileVarOffsets = tileVarOffsets; } public FragmentMetadata tileVarSizes(List> tileVarSizes) { - this.tileVarSizes = tileVarSizes; return this; } @@ -433,25 +399,21 @@ public FragmentMetadata addTileVarSizesItem(List tileVarSizesItem) { return this; } - /** + /** * Get tileVarSizes * @return tileVarSizes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileVarSizes() { return tileVarSizes; } - public void setTileVarSizes(List> tileVarSizes) { this.tileVarSizes = tileVarSizes; } public FragmentMetadata tileValidityOffsets(List> tileValidityOffsets) { - this.tileValidityOffsets = tileValidityOffsets; return this; } @@ -464,25 +426,21 @@ public FragmentMetadata addTileValidityOffsetsItem(List tileValidityOff return this; } - /** + /** * Get tileValidityOffsets * @return tileValidityOffsets - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileValidityOffsets() { return tileValidityOffsets; } - public void setTileValidityOffsets(List> tileValidityOffsets) { this.tileValidityOffsets = tileValidityOffsets; } public FragmentMetadata tileMinBuffer(List> tileMinBuffer) { - this.tileMinBuffer = tileMinBuffer; return this; } @@ -495,25 +453,21 @@ public FragmentMetadata addTileMinBufferItem(List tileMinBufferItem) { return this; } - /** + /** * Get tileMinBuffer * @return tileMinBuffer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileMinBuffer() { return tileMinBuffer; } - public void setTileMinBuffer(List> tileMinBuffer) { this.tileMinBuffer = tileMinBuffer; } public FragmentMetadata tileMinVarBuffer(List> tileMinVarBuffer) { - this.tileMinVarBuffer = tileMinVarBuffer; return this; } @@ -526,25 +480,21 @@ public FragmentMetadata addTileMinVarBufferItem(List tileMinVarBufferIt return this; } - /** + /** * Get tileMinVarBuffer * @return tileMinVarBuffer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileMinVarBuffer() { return tileMinVarBuffer; } - public void setTileMinVarBuffer(List> tileMinVarBuffer) { this.tileMinVarBuffer = tileMinVarBuffer; } public FragmentMetadata tileMaxBuffer(List> tileMaxBuffer) { - this.tileMaxBuffer = tileMaxBuffer; return this; } @@ -557,25 +507,21 @@ public FragmentMetadata addTileMaxBufferItem(List tileMaxBufferItem) { return this; } - /** + /** * Get tileMaxBuffer * @return tileMaxBuffer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileMaxBuffer() { return tileMaxBuffer; } - public void setTileMaxBuffer(List> tileMaxBuffer) { this.tileMaxBuffer = tileMaxBuffer; } public FragmentMetadata tileMaxVarBuffer(List> tileMaxVarBuffer) { - this.tileMaxVarBuffer = tileMaxVarBuffer; return this; } @@ -588,25 +534,21 @@ public FragmentMetadata addTileMaxVarBufferItem(List tileMaxVarBufferIt return this; } - /** + /** * Get tileMaxVarBuffer * @return tileMaxVarBuffer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileMaxVarBuffer() { return tileMaxVarBuffer; } - public void setTileMaxVarBuffer(List> tileMaxVarBuffer) { this.tileMaxVarBuffer = tileMaxVarBuffer; } public FragmentMetadata tileSums(List> tileSums) { - this.tileSums = tileSums; return this; } @@ -619,25 +561,21 @@ public FragmentMetadata addTileSumsItem(List tileSumsItem) { return this; } - /** + /** * Get tileSums * @return tileSums - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileSums() { return tileSums; } - public void setTileSums(List> tileSums) { this.tileSums = tileSums; } public FragmentMetadata tileNullCounts(List> tileNullCounts) { - this.tileNullCounts = tileNullCounts; return this; } @@ -650,25 +588,21 @@ public FragmentMetadata addTileNullCountsItem(List tileNullCountsItem) return this; } - /** + /** * Get tileNullCounts * @return tileNullCounts - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getTileNullCounts() { return tileNullCounts; } - public void setTileNullCounts(List> tileNullCounts) { this.tileNullCounts = tileNullCounts; } public FragmentMetadata fragmentMins(List> fragmentMins) { - this.fragmentMins = fragmentMins; return this; } @@ -681,25 +615,21 @@ public FragmentMetadata addFragmentMinsItem(List fragmentMinsItem) { return this; } - /** + /** * Get fragmentMins * @return fragmentMins - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getFragmentMins() { return fragmentMins; } - public void setFragmentMins(List> fragmentMins) { this.fragmentMins = fragmentMins; } public FragmentMetadata fragmentMaxs(List> fragmentMaxs) { - this.fragmentMaxs = fragmentMaxs; return this; } @@ -712,25 +642,21 @@ public FragmentMetadata addFragmentMaxsItem(List fragmentMaxsItem) { return this; } - /** + /** * Get fragmentMaxs * @return fragmentMaxs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List> getFragmentMaxs() { return fragmentMaxs; } - public void setFragmentMaxs(List> fragmentMaxs) { this.fragmentMaxs = fragmentMaxs; } public FragmentMetadata fragmentSums(List fragmentSums) { - this.fragmentSums = fragmentSums; return this; } @@ -743,25 +669,21 @@ public FragmentMetadata addFragmentSumsItem(Integer fragmentSumsItem) { return this; } - /** + /** * Get fragmentSums * @return fragmentSums - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getFragmentSums() { return fragmentSums; } - public void setFragmentSums(List fragmentSums) { this.fragmentSums = fragmentSums; } public FragmentMetadata fragmentNullCounts(List fragmentNullCounts) { - this.fragmentNullCounts = fragmentNullCounts; return this; } @@ -774,48 +696,40 @@ public FragmentMetadata addFragmentNullCountsItem(Integer fragmentNullCountsItem return this; } - /** + /** * Get fragmentNullCounts * @return fragmentNullCounts - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getFragmentNullCounts() { return fragmentNullCounts; } - public void setFragmentNullCounts(List fragmentNullCounts) { this.fragmentNullCounts = fragmentNullCounts; } public FragmentMetadata version(Integer version) { - this.version = version; return this; } - /** + /** * Get version * @return version - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getVersion() { return version; } - public void setVersion(Integer version) { this.version = version; } public FragmentMetadata timestampRange(List timestampRange) { - this.timestampRange = timestampRange; return this; } @@ -828,80 +742,38 @@ public FragmentMetadata addTimestampRangeItem(Integer timestampRangeItem) { return this; } - /** + /** * Get timestampRange * @return timestampRange - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getTimestampRange() { return timestampRange; } - public void setTimestampRange(List timestampRange) { this.timestampRange = timestampRange; } public FragmentMetadata lastTileCellNum(Integer lastTileCellNum) { - this.lastTileCellNum = lastTileCellNum; return this; } - /** + /** * Get lastTileCellNum * @return lastTileCellNum - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Integer getLastTileCellNum() { return lastTileCellNum; } - public void setLastTileCellNum(Integer lastTileCellNum) { this.lastTileCellNum = lastTileCellNum; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public FragmentMetadata putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -937,13 +809,12 @@ public boolean equals(Object o) { Objects.equals(this.fragmentNullCounts, fragmentMetadata.fragmentNullCounts) && Objects.equals(this.version, fragmentMetadata.version) && Objects.equals(this.timestampRange, fragmentMetadata.timestampRange) && - Objects.equals(this.lastTileCellNum, fragmentMetadata.lastTileCellNum)&& - Objects.equals(this.additionalProperties, fragmentMetadata.additionalProperties); + Objects.equals(this.lastTileCellNum, fragmentMetadata.lastTileCellNum); } @Override public int hashCode() { - return Objects.hash(fileSizes, fileVarSizes, fileValiditySizes, fragmentUri, hasTimestamps, hasDeleteMeta, sparseTileNum, tileIndexBase, tileOffsets, tileVarOffsets, tileVarSizes, tileValidityOffsets, tileMinBuffer, tileMinVarBuffer, tileMaxBuffer, tileMaxVarBuffer, tileSums, tileNullCounts, fragmentMins, fragmentMaxs, fragmentSums, fragmentNullCounts, version, timestampRange, lastTileCellNum, additionalProperties); + return Objects.hash(fileSizes, fileVarSizes, fileValiditySizes, fragmentUri, hasTimestamps, hasDeleteMeta, sparseTileNum, tileIndexBase, tileOffsets, tileVarOffsets, tileVarSizes, tileValidityOffsets, tileMinBuffer, tileMinVarBuffer, tileMaxBuffer, tileMaxVarBuffer, tileSums, tileNullCounts, fragmentMins, fragmentMaxs, fragmentSums, fragmentNullCounts, version, timestampRange, lastTileCellNum); } @Override @@ -975,7 +846,6 @@ public String toString() { sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" timestampRange: ").append(toIndentedString(timestampRange)).append("\n"); sb.append(" lastTileCellNum: ").append(toIndentedString(lastTileCellNum)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1028,93 +898,100 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FragmentMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (FragmentMetadata.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 FragmentMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FragmentMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in FragmentMetadata is not found in the empty JSON string", FragmentMetadata.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("fileSizes") != null && !jsonObj.get("fileSizes").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FragmentMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FragmentMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("fileSizes") != null && !jsonObj.get("fileSizes").isJsonNull() && !jsonObj.get("fileSizes").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fileSizes` to be an array in the JSON string but got `%s`", jsonObj.get("fileSizes").toString())); } - // ensure the json data is an array - if (jsonObj.get("fileVarSizes") != null && !jsonObj.get("fileVarSizes").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fileVarSizes") != null && !jsonObj.get("fileVarSizes").isJsonNull() && !jsonObj.get("fileVarSizes").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fileVarSizes` to be an array in the JSON string but got `%s`", jsonObj.get("fileVarSizes").toString())); } - // ensure the json data is an array - if (jsonObj.get("fileValiditySizes") != null && !jsonObj.get("fileValiditySizes").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fileValiditySizes") != null && !jsonObj.get("fileValiditySizes").isJsonNull() && !jsonObj.get("fileValiditySizes").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fileValiditySizes` to be an array in the JSON string but got `%s`", jsonObj.get("fileValiditySizes").toString())); } - if (jsonObj.get("fragmentUri") != null && !jsonObj.get("fragmentUri").isJsonPrimitive()) { + if ((jsonObj.get("fragmentUri") != null && !jsonObj.get("fragmentUri").isJsonNull()) && !jsonObj.get("fragmentUri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fragmentUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fragmentUri").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileOffsets") != null && !jsonObj.get("tileOffsets").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileOffsets") != null && !jsonObj.get("tileOffsets").isJsonNull() && !jsonObj.get("tileOffsets").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileOffsets").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileVarOffsets") != null && !jsonObj.get("tileVarOffsets").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileVarOffsets") != null && !jsonObj.get("tileVarOffsets").isJsonNull() && !jsonObj.get("tileVarOffsets").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileVarOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileVarOffsets").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileVarSizes") != null && !jsonObj.get("tileVarSizes").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileVarSizes") != null && !jsonObj.get("tileVarSizes").isJsonNull() && !jsonObj.get("tileVarSizes").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileVarSizes` to be an array in the JSON string but got `%s`", jsonObj.get("tileVarSizes").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileValidityOffsets") != null && !jsonObj.get("tileValidityOffsets").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileValidityOffsets") != null && !jsonObj.get("tileValidityOffsets").isJsonNull() && !jsonObj.get("tileValidityOffsets").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileValidityOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileValidityOffsets").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileMinBuffer") != null && !jsonObj.get("tileMinBuffer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileMinBuffer") != null && !jsonObj.get("tileMinBuffer").isJsonNull() && !jsonObj.get("tileMinBuffer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileMinBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMinBuffer").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileMinVarBuffer") != null && !jsonObj.get("tileMinVarBuffer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileMinVarBuffer") != null && !jsonObj.get("tileMinVarBuffer").isJsonNull() && !jsonObj.get("tileMinVarBuffer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileMinVarBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMinVarBuffer").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileMaxBuffer") != null && !jsonObj.get("tileMaxBuffer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileMaxBuffer") != null && !jsonObj.get("tileMaxBuffer").isJsonNull() && !jsonObj.get("tileMaxBuffer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileMaxBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMaxBuffer").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileMaxVarBuffer") != null && !jsonObj.get("tileMaxVarBuffer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileMaxVarBuffer") != null && !jsonObj.get("tileMaxVarBuffer").isJsonNull() && !jsonObj.get("tileMaxVarBuffer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileMaxVarBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMaxVarBuffer").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileSums") != null && !jsonObj.get("tileSums").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileSums") != null && !jsonObj.get("tileSums").isJsonNull() && !jsonObj.get("tileSums").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileSums` to be an array in the JSON string but got `%s`", jsonObj.get("tileSums").toString())); } - // ensure the json data is an array - if (jsonObj.get("tileNullCounts") != null && !jsonObj.get("tileNullCounts").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tileNullCounts") != null && !jsonObj.get("tileNullCounts").isJsonNull() && !jsonObj.get("tileNullCounts").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tileNullCounts` to be an array in the JSON string but got `%s`", jsonObj.get("tileNullCounts").toString())); } - // ensure the json data is an array - if (jsonObj.get("fragmentMins") != null && !jsonObj.get("fragmentMins").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fragmentMins") != null && !jsonObj.get("fragmentMins").isJsonNull() && !jsonObj.get("fragmentMins").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fragmentMins` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentMins").toString())); } - // ensure the json data is an array - if (jsonObj.get("fragmentMaxs") != null && !jsonObj.get("fragmentMaxs").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fragmentMaxs") != null && !jsonObj.get("fragmentMaxs").isJsonNull() && !jsonObj.get("fragmentMaxs").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fragmentMaxs` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentMaxs").toString())); } - // ensure the json data is an array - if (jsonObj.get("fragmentSums") != null && !jsonObj.get("fragmentSums").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fragmentSums") != null && !jsonObj.get("fragmentSums").isJsonNull() && !jsonObj.get("fragmentSums").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fragmentSums` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentSums").toString())); } - // ensure the json data is an array - if (jsonObj.get("fragmentNullCounts") != null && !jsonObj.get("fragmentNullCounts").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fragmentNullCounts") != null && !jsonObj.get("fragmentNullCounts").isJsonNull() && !jsonObj.get("fragmentNullCounts").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `fragmentNullCounts` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentNullCounts").toString())); } - // ensure the json data is an array - if (jsonObj.get("timestampRange") != null && !jsonObj.get("timestampRange").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("timestampRange") != null && !jsonObj.get("timestampRange").isJsonNull() && !jsonObj.get("timestampRange").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `timestampRange` to be an array in the JSON string but got `%s`", jsonObj.get("timestampRange").toString())); } } @@ -1134,71 +1011,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, FragmentMetadata value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public FragmentMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - FragmentMetadata instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of FragmentMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of FragmentMetadata - * @throws IOException if the JSON string is invalid with respect to FragmentMetadata - */ + /** + * Create an instance of FragmentMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of FragmentMetadata + * @throws IOException if the JSON string is invalid with respect to FragmentMetadata + */ public static FragmentMetadata fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FragmentMetadata.class); } - /** - * Convert an instance of FragmentMetadata to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FragmentMetadata 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/model/GenericUDF.java b/src/main/java/io/tiledb/cloud/rest_api/model/GenericUDF.java index 1d53e9e..6c01487 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GenericUDF.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GenericUDF.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ResultFormat; +import io.tiledb.cloud.rest_api.model.UDFLanguage; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +53,7 @@ /** * User-defined function */ -@ApiModel(description = "User-defined function") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GenericUDF { public static final String SERIALIZED_NAME_UDF_INFO_NAME = "udf_info_name"; @SerializedName(SERIALIZED_NAME_UDF_INFO_NAME) @@ -84,7 +93,7 @@ public class GenericUDF { public static final String SERIALIZED_NAME_STORED_PARAM_UUIDS = "stored_param_uuids"; @SerializedName(SERIALIZED_NAME_STORED_PARAM_UUIDS) - private List storedParamUuids = null; + private List storedParamUuids = new ArrayList<>(); public static final String SERIALIZED_NAME_RESULT_FORMAT = "result_format"; @SerializedName(SERIALIZED_NAME_RESULT_FORMAT) @@ -114,218 +123,181 @@ public class GenericUDF { @SerializedName(SERIALIZED_NAME_CLIENT_NODE_UUID) private String clientNodeUuid; - public GenericUDF() { + public GenericUDF() { } public GenericUDF udfInfoName(String udfInfoName) { - this.udfInfoName = udfInfoName; return this; } - /** + /** * name of UDFInfo to run, format is {namespace}/{udf_name}. Can not be used with exec * @return udfInfoName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "TileDB-Inc/csv_ingestor", value = "name of UDFInfo to run, format is {namespace}/{udf_name}. Can not be used with exec") - public String getUdfInfoName() { return udfInfoName; } - public void setUdfInfoName(String udfInfoName) { this.udfInfoName = udfInfoName; } public GenericUDF language(UDFLanguage language) { - this.language = language; return this; } - /** + /** * Get language * @return language - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFLanguage getLanguage() { return language; } - public void setLanguage(UDFLanguage language) { this.language = language; } public GenericUDF version(String version) { - this.version = version; return this; } - /** + /** * Type-specific version * @return version - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Type-specific version") - public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } public GenericUDF imageName(String imageName) { - this.imageName = imageName; return this; } - /** + /** * Docker image name to use for UDF * @return imageName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Docker image name to use for UDF") - public String getImageName() { return imageName; } - public void setImageName(String imageName) { this.imageName = imageName; } public GenericUDF accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * The name of the access credentials to use. if unset, no credentials will be configured in the environment. * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the access credentials to use. if unset, no credentials will be configured in the environment.") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public GenericUDF resourceClass(String resourceClass) { - this.resourceClass = resourceClass; return this; } - /** + /** * The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the UDF will execute in the standard resource class of the TileDB Cloud provider. * @return resourceClass - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "standard", value = "The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the UDF will execute in the standard resource class of the TileDB Cloud provider. ") - public String getResourceClass() { return resourceClass; } - public void setResourceClass(String resourceClass) { this.resourceClass = resourceClass; } public GenericUDF exec(String exec) { - this.exec = exec; return this; } - /** + /** * Type-specific executable text * @return exec - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Type-specific executable text") - public String getExec() { return exec; } - public void setExec(String exec) { this.exec = exec; } public GenericUDF execRaw(String execRaw) { - this.execRaw = execRaw; return this; } - /** + /** * optional raw text to store of serialized function, used for showing in UI * @return execRaw - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional raw text to store of serialized function, used for showing in UI") - public String getExecRaw() { return execRaw; } - public void setExecRaw(String execRaw) { this.execRaw = execRaw; } public GenericUDF argument(String argument) { - this.argument = argument; return this; } - /** + /** * Argument(s) to pass to UDF function, tuple or list of args/kwargs which can be in native or JSON format * @return argument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Argument(s) to pass to UDF function, tuple or list of args/kwargs which can be in native or JSON format") - public String getArgument() { return argument; } - public void setArgument(String argument) { this.argument = argument; } public GenericUDF storedParamUuids(List storedParamUuids) { - this.storedParamUuids = storedParamUuids; return this; } @@ -338,218 +310,152 @@ public GenericUDF addStoredParamUuidsItem(String storedParamUuidsItem) { return this; } - /** + /** * The UUIDs of stored input parameters (passed in a language-specific format within \"argument\") to be retrieved from the server-side cache. Serialized in standard hex format with no {}. * @return storedParamUuids - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The UUIDs of stored input parameters (passed in a language-specific format within \"argument\") to be retrieved from the server-side cache. Serialized in standard hex format with no {}.") - public List getStoredParamUuids() { return storedParamUuids; } - public void setStoredParamUuids(List storedParamUuids) { this.storedParamUuids = storedParamUuids; } public GenericUDF resultFormat(ResultFormat resultFormat) { - this.resultFormat = resultFormat; return this; } - /** + /** * Get resultFormat * @return resultFormat - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ResultFormat getResultFormat() { return resultFormat; } - public void setResultFormat(ResultFormat resultFormat) { this.resultFormat = resultFormat; } public GenericUDF taskName(String taskName) { - this.taskName = taskName; return this; } - /** + /** * name of task, optional * @return taskName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of task, optional") - public String getTaskName() { return taskName; } - public void setTaskName(String taskName) { this.taskName = taskName; } public GenericUDF storeResults(Boolean storeResults) { - this.storeResults = storeResults; return this; } - /** + /** * store results for later retrieval * @return storeResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "store results for later retrieval") - public Boolean getStoreResults() { return storeResults; } - public void setStoreResults(Boolean storeResults) { this.storeResults = storeResults; } public GenericUDF timeout(Integer timeout) { - this.timeout = timeout; return this; } - /** + /** * UDF-type timeout in seconds (default: 900) * @return timeout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "UDF-type timeout in seconds (default: 900)") - public Integer getTimeout() { return timeout; } - public void setTimeout(Integer timeout) { this.timeout = timeout; } public GenericUDF dontDownloadResults(Boolean dontDownloadResults) { - this.dontDownloadResults = dontDownloadResults; return this; } - /** + /** * Set to true to avoid downloading the results of this UDF. Useful for intermediate nodes in a task graph where you will not be using the results of your function. Defaults to false (\"yes download results\"). * @return dontDownloadResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set to true to avoid downloading the results of this UDF. Useful for intermediate nodes in a task graph where you will not be using the results of your function. Defaults to false (\"yes download results\").") - public Boolean getDontDownloadResults() { return dontDownloadResults; } - public void setDontDownloadResults(Boolean dontDownloadResults) { this.dontDownloadResults = dontDownloadResults; } public GenericUDF taskGraphUuid(String taskGraphUuid) { - this.taskGraphUuid = taskGraphUuid; return this; } - /** + /** * If set, the ID of the log for the task graph that this was part of. * @return taskGraphUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the ID of the log for the task graph that this was part of. ") - public String getTaskGraphUuid() { return taskGraphUuid; } - public void setTaskGraphUuid(String taskGraphUuid) { this.taskGraphUuid = taskGraphUuid; } public GenericUDF clientNodeUuid(String clientNodeUuid) { - this.clientNodeUuid = clientNodeUuid; return this; } - /** + /** * If set, the client-defined ID of the node within this task's graph. * @return clientNodeUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the client-defined ID of the node within this task's graph. ") - public String getClientNodeUuid() { return clientNodeUuid; } - public void setClientNodeUuid(String clientNodeUuid) { this.clientNodeUuid = clientNodeUuid; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GenericUDF putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -577,13 +483,12 @@ public boolean equals(Object o) { Objects.equals(this.timeout, genericUDF.timeout) && Objects.equals(this.dontDownloadResults, genericUDF.dontDownloadResults) && Objects.equals(this.taskGraphUuid, genericUDF.taskGraphUuid) && - Objects.equals(this.clientNodeUuid, genericUDF.clientNodeUuid)&& - Objects.equals(this.additionalProperties, genericUDF.additionalProperties); + Objects.equals(this.clientNodeUuid, genericUDF.clientNodeUuid); } @Override public int hashCode() { - return Objects.hash(udfInfoName, language, version, imageName, accessCredentialsName, resourceClass, exec, execRaw, argument, storedParamUuids, resultFormat, taskName, storeResults, timeout, dontDownloadResults, taskGraphUuid, clientNodeUuid, additionalProperties); + return Objects.hash(udfInfoName, language, version, imageName, accessCredentialsName, resourceClass, exec, execRaw, argument, storedParamUuids, resultFormat, taskName, storeResults, timeout, dontDownloadResults, taskGraphUuid, clientNodeUuid); } @Override @@ -607,7 +512,6 @@ public String toString() { sb.append(" dontDownloadResults: ").append(toIndentedString(dontDownloadResults)).append("\n"); sb.append(" taskGraphUuid: ").append(toIndentedString(taskGraphUuid)).append("\n"); sb.append(" clientNodeUuid: ").append(toIndentedString(clientNodeUuid)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -652,55 +556,70 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GenericUDF - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GenericUDF.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GenericUDF + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GenericUDF.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GenericUDF is not found in the empty JSON string", GenericUDF.openapiRequiredFields.toString())); } } - if (jsonObj.get("udf_info_name") != null && !jsonObj.get("udf_info_name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GenericUDF.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenericUDF` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("udf_info_name") != null && !jsonObj.get("udf_info_name").isJsonNull()) && !jsonObj.get("udf_info_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `udf_info_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("udf_info_name").toString())); } - if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonPrimitive()) { + // validate the optional field `language` + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) { + UDFLanguage.validateJsonElement(jsonObj.get("language")); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } - if (jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonPrimitive()) { + if ((jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonNull()) && !jsonObj.get("image_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `image_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_name").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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("resource_class") != null && !jsonObj.get("resource_class").isJsonPrimitive()) { + if ((jsonObj.get("resource_class") != null && !jsonObj.get("resource_class").isJsonNull()) && !jsonObj.get("resource_class").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `resource_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource_class").toString())); } - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonPrimitive()) { + if ((jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) && !jsonObj.get("exec").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exec").toString())); } - if (jsonObj.get("exec_raw") != null && !jsonObj.get("exec_raw").isJsonPrimitive()) { + if ((jsonObj.get("exec_raw") != null && !jsonObj.get("exec_raw").isJsonNull()) && !jsonObj.get("exec_raw").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exec_raw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exec_raw").toString())); } - if (jsonObj.get("argument") != null && !jsonObj.get("argument").isJsonPrimitive()) { + if ((jsonObj.get("argument") != null && !jsonObj.get("argument").isJsonNull()) && !jsonObj.get("argument").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `argument` to be a primitive type in the JSON string but got `%s`", jsonObj.get("argument").toString())); } - // ensure the json data is an array - if (jsonObj.get("stored_param_uuids") != null && !jsonObj.get("stored_param_uuids").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("stored_param_uuids") != null && !jsonObj.get("stored_param_uuids").isJsonNull() && !jsonObj.get("stored_param_uuids").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `stored_param_uuids` to be an array in the JSON string but got `%s`", jsonObj.get("stored_param_uuids").toString())); } - if (jsonObj.get("task_name") != null && !jsonObj.get("task_name").isJsonPrimitive()) { + // validate the optional field `result_format` + if (jsonObj.get("result_format") != null && !jsonObj.get("result_format").isJsonNull()) { + ResultFormat.validateJsonElement(jsonObj.get("result_format")); + } + if ((jsonObj.get("task_name") != null && !jsonObj.get("task_name").isJsonNull()) && !jsonObj.get("task_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `task_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_name").toString())); } - if (jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { + if ((jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonNull()) && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `task_graph_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_graph_uuid").toString())); } - if (jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { + if ((jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonNull()) && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `client_node_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_uuid").toString())); } } @@ -720,71 +639,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GenericUDF value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GenericUDF read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GenericUDF instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GenericUDF given an JSON string - * - * @param jsonString JSON string - * @return An instance of GenericUDF - * @throws IOException if the JSON string is invalid with respect to GenericUDF - */ + /** + * Create an instance of GenericUDF given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenericUDF + * @throws IOException if the JSON string is invalid with respect to GenericUDF + */ public static GenericUDF fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GenericUDF.class); } - /** - * Convert an instance of GenericUDF to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GenericUDF 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/model/GetTiledbStats200Response.java b/src/main/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200Response.java index 22ac554..b720f83 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200Response.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200Response.java @@ -14,25 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -40,72 +49,33 @@ /** * GetTiledbStats200Response */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GetTiledbStats200Response { public static final String SERIALIZED_NAME_STATS = "stats"; @SerializedName(SERIALIZED_NAME_STATS) private String stats; - public GetTiledbStats200Response() { + public GetTiledbStats200Response() { } public GetTiledbStats200Response stats(String stats) { - this.stats = stats; return this; } - /** + /** * string of stats from tiledb * @return stats - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "123", value = "string of stats from tiledb") - public String getStats() { return stats; } - public void setStats(String stats) { this.stats = stats; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GetTiledbStats200Response putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -117,13 +87,12 @@ public boolean equals(Object o) { return false; } GetTiledbStats200Response getTiledbStats200Response = (GetTiledbStats200Response) o; - return Objects.equals(this.stats, getTiledbStats200Response.stats)&& - Objects.equals(this.additionalProperties, getTiledbStats200Response.additionalProperties); + return Objects.equals(this.stats, getTiledbStats200Response.stats); } @Override public int hashCode() { - return Objects.hash(stats, additionalProperties); + return Objects.hash(stats); } @Override @@ -131,7 +100,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetTiledbStats200Response {\n"); sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -160,21 +128,28 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTiledbStats200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GetTiledbStats200Response.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GetTiledbStats200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetTiledbStats200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GetTiledbStats200Response is not found in the empty JSON string", GetTiledbStats200Response.openapiRequiredFields.toString())); } } - if (jsonObj.get("stats") != null && !jsonObj.get("stats").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetTiledbStats200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTiledbStats200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } } @@ -194,71 +169,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GetTiledbStats200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GetTiledbStats200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GetTiledbStats200Response instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GetTiledbStats200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTiledbStats200Response - * @throws IOException if the JSON string is invalid with respect to GetTiledbStats200Response - */ + /** + * Create an instance of GetTiledbStats200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTiledbStats200Response + * @throws IOException if the JSON string is invalid with respect to GetTiledbStats200Response + */ public static GetTiledbStats200Response fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GetTiledbStats200Response.class); } - /** - * Convert an instance of GetTiledbStats200Response to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GetTiledbStats200Response 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/model/GroupActions.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActions.java index 8454a17..d337b90 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupActions.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActions.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public GroupActions read(final JsonReader jsonReader) throws IOException { return GroupActions.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GroupActions.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivity.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivity.java new file mode 100644 index 0000000..ea72559 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivity.java @@ -0,0 +1,300 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.2.19 + * + * + * 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.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.JSON; + +/** + * Object containing activity of an asset of a group + */ +@ApiModel(description = "Object containing activity of an asset of a group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-02T12:25:58.319138+03:00[Europe/Athens]") +public class GroupActivity { + public static final String SERIALIZED_NAME_ASSET = "asset"; + @SerializedName(SERIALIZED_NAME_ASSET) + private GroupActivityAsset asset; + + public static final String SERIALIZED_NAME_ACTIVITY_LOG = "activity_log"; + @SerializedName(SERIALIZED_NAME_ACTIVITY_LOG) + private ArrayActivityLog activityLog; + + public GroupActivity() { + } + + public GroupActivity asset(GroupActivityAsset asset) { + + this.asset = asset; + return this; + } + + /** + * Get asset + * @return asset + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GroupActivityAsset getAsset() { + return asset; + } + + + public void setAsset(GroupActivityAsset asset) { + this.asset = asset; + } + + + public GroupActivity activityLog(ArrayActivityLog activityLog) { + + this.activityLog = activityLog; + return this; + } + + /** + * Get activityLog + * @return activityLog + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArrayActivityLog getActivityLog() { + return activityLog; + } + + + public void setActivityLog(ArrayActivityLog activityLog) { + this.activityLog = activityLog; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupActivity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupActivity groupActivity = (GroupActivity) o; + return Objects.equals(this.asset, groupActivity.asset) && + Objects.equals(this.activityLog, groupActivity.activityLog)&& + Objects.equals(this.additionalProperties, groupActivity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(asset, activityLog, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupActivity {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" activityLog: ").append(toIndentedString(activityLog)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("activity_log"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupActivity + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupActivity.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupActivity is not found in the empty JSON string", GroupActivity.openapiRequiredFields.toString())); + } + } + // validate the optional field `asset` + if (jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) { + GroupActivityAsset.validateJsonObject(jsonObj.getAsJsonObject("asset")); + } + // validate the optional field `activity_log` + if (jsonObj.get("activity_log") != null && !jsonObj.get("activity_log").isJsonNull()) { + ArrayActivityLog.validateJsonElement(jsonObj.getAsJsonObject("activity_log")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupActivity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupActivity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupActivity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupActivity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupActivity read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupActivity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupActivity given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupActivity + * @throws IOException if the JSON string is invalid with respect to GroupActivity + */ + public static GroupActivity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupActivity.class); + } + + /** + * Convert an instance of GroupActivity 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/model/GroupActivityAsset.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivityAsset.java new file mode 100644 index 0000000..f4302a5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivityAsset.java @@ -0,0 +1,361 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.2.19 + * + * + * 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.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.JSON; + +/** + * The asset details + */ +@ApiModel(description = "The asset details") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-02T12:25:58.319138+03:00[Europe/Athens]") +public class GroupActivityAsset { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace; + + public static final String SERIALIZED_NAME_ASSET_TYPE = "asset_type"; + @SerializedName(SERIALIZED_NAME_ASSET_TYPE) + private AssetType assetType; + + public GroupActivityAsset() { + } + + public GroupActivityAsset id(String id) { + + this.id = id; + return this; + } + + /** + * The asset ID + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The asset ID") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GroupActivityAsset name(String name) { + + this.name = name; + return this; + } + + /** + * The asset name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The asset name") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public GroupActivityAsset namespace(String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * The namespace that the asset belongs to + * @return namespace + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The namespace that the asset belongs to") + + public String getNamespace() { + return namespace; + } + + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + + public GroupActivityAsset assetType(AssetType assetType) { + + this.assetType = assetType; + return this; + } + + /** + * Get assetType + * @return assetType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AssetType getAssetType() { + return assetType; + } + + + public void setAssetType(AssetType assetType) { + this.assetType = assetType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupActivityAsset putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupActivityAsset groupActivityAsset = (GroupActivityAsset) o; + return Objects.equals(this.id, groupActivityAsset.id) && + Objects.equals(this.name, groupActivityAsset.name) && + Objects.equals(this.namespace, groupActivityAsset.namespace) && + Objects.equals(this.assetType, groupActivityAsset.assetType)&& + Objects.equals(this.additionalProperties, groupActivityAsset.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, namespace, assetType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupActivityAsset {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("namespace"); + openapiFields.add("asset_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupActivityAsset + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupActivityAsset.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupActivityAsset is not found in the empty JSON string", GroupActivityAsset.openapiRequiredFields.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())); + } + 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("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupActivityAsset.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupActivityAsset' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupActivityAsset.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupActivityAsset value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupActivityAsset read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupActivityAsset instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupActivityAsset given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupActivityAsset + * @throws IOException if the JSON string is invalid with respect to GroupActivityAsset + */ + public static GroupActivityAsset fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupActivityAsset.class); + } + + /** + * Convert an instance of GroupActivityAsset 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/model/GroupActivityResponse.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivityResponse.java new file mode 100644 index 0000000..c309669 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupActivityResponse.java @@ -0,0 +1,319 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.2.19 + * + * + * 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.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.JSON; + +/** + * Object containing activity logs of group content along with the pagination metadata + */ +@ApiModel(description = "Object containing activity logs of group content along with the pagination metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-02T12:25:58.319138+03:00[Europe/Athens]") +public class GroupActivityResponse { + public static final String SERIALIZED_NAME_ACTIVITY = "activity"; + @SerializedName(SERIALIZED_NAME_ACTIVITY) + private List activity = null; + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + private PaginationMetadata paginationMetadata; + + public GroupActivityResponse() { + } + + public GroupActivityResponse activity(List activity) { + + this.activity = activity; + return this; + } + + public GroupActivityResponse addActivityItem(GroupActivity activityItem) { + if (this.activity == null) { + this.activity = new ArrayList<>(); + } + this.activity.add(activityItem); + return this; + } + + /** + * Activity of a group's content + * @return activity + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Activity of a group's content") + + public List getActivity() { + return activity; + } + + + public void setActivity(List activity) { + this.activity = activity; + } + + + public GroupActivityResponse paginationMetadata(PaginationMetadata paginationMetadata) { + + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + + public void setPaginationMetadata(PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupActivityResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupActivityResponse groupActivityResponse = (GroupActivityResponse) o; + return Objects.equals(this.activity, groupActivityResponse.activity) && + Objects.equals(this.paginationMetadata, groupActivityResponse.paginationMetadata)&& + Objects.equals(this.additionalProperties, groupActivityResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(activity, paginationMetadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupActivityResponse {\n"); + sb.append(" activity: ").append(toIndentedString(activity)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activity"); + openapiFields.add("pagination_metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupActivityResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupActivityResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupActivityResponse is not found in the empty JSON string", GroupActivityResponse.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayactivity = jsonObj.getAsJsonArray("activity"); + if (jsonArrayactivity != null) { + // ensure the json data is an array + if (!jsonObj.get("activity").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `activity` to be an array in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + + // validate the optional field `activity` (array) + for (int i = 0; i < jsonArrayactivity.size(); i++) { + GroupActivity.validateJsonObject(jsonArrayactivity.get(i).getAsJsonObject()); + }; + } + // validate the optional field `pagination_metadata` + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.getAsJsonObject("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupActivityResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupActivityResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupActivityResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupActivityResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupActivityResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupActivityResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupActivityResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupActivityResponse + * @throws IOException if the JSON string is invalid with respect to GroupActivityResponse + */ + public static GroupActivityResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupActivityResponse.class); + } + + /** + * Convert an instance of GroupActivityResponse 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/model/GroupBrowserData.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupBrowserData.java index f244013..8f0cd28 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupBrowserData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupBrowserData.java @@ -14,51 +14,59 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Object including group info and pagination metadata */ -@ApiModel(description = "Object including group info and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupBrowserData { public static final String SERIALIZED_NAME_GROUPS = "groups"; @SerializedName(SERIALIZED_NAME_GROUPS) - private List groups = null; + private List groups = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public GroupBrowserData() { + public GroupBrowserData() { } public GroupBrowserData groups(List groups) { - this.groups = groups; return this; } @@ -71,80 +79,38 @@ public GroupBrowserData addGroupsItem(GroupInfo groupsItem) { return this; } - /** + /** * Groups Info * @return groups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Groups Info") - public List getGroups() { return groups; } - public void setGroups(List groups) { this.groups = groups; } public GroupBrowserData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupBrowserData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +123,12 @@ public boolean equals(Object o) { } GroupBrowserData groupBrowserData = (GroupBrowserData) o; return Objects.equals(this.groups, groupBrowserData.groups) && - Objects.equals(this.paginationMetadata, groupBrowserData.paginationMetadata)&& - Objects.equals(this.additionalProperties, groupBrowserData.additionalProperties); + Objects.equals(this.paginationMetadata, groupBrowserData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(groups, paginationMetadata, additionalProperties); + return Objects.hash(groups, paginationMetadata); } @Override @@ -172,7 +137,6 @@ public String toString() { sb.append("class GroupBrowserData {\n"); sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupBrowserData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupBrowserData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupBrowserData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupBrowserData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupBrowserData is not found in the empty JSON string", GroupBrowserData.openapiRequiredFields.toString())); } } - JsonArray jsonArraygroups = jsonObj.getAsJsonArray("groups"); - if (jsonArraygroups != null) { - // ensure the json data is an array - if (!jsonObj.get("groups").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `groups` to be an array in the JSON string but got `%s`", jsonObj.get("groups").toString())); - } - // validate the optional field `groups` (array) - for (int i = 0; i < jsonArraygroups.size(); i++) { - GroupInfo.validateJsonObject(jsonArraygroups.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupBrowserData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupBrowserData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("groups") != null && !jsonObj.get("groups").isJsonNull()) { + JsonArray jsonArraygroups = jsonObj.getAsJsonArray("groups"); + if (jsonArraygroups != null) { + // ensure the json data is an array + if (!jsonObj.get("groups").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `groups` to be an array in the JSON string but got `%s`", jsonObj.get("groups").toString())); + } + + // validate the optional field `groups` (array) + for (int i = 0; i < jsonArraygroups.size(); i++) { + GroupInfo.validateJsonElement(jsonArraygroups.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -249,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupBrowserData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupBrowserData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupBrowserData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupBrowserData given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupBrowserData - * @throws IOException if the JSON string is invalid with respect to GroupBrowserData - */ + /** + * Create an instance of GroupBrowserData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupBrowserData + * @throws IOException if the JSON string is invalid with respect to GroupBrowserData + */ public static GroupBrowserData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupBrowserData.class); } - /** - * Convert an instance of GroupBrowserData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupBrowserData 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/model/GroupBrowserFilterData.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterData.java index 4a09b5c..a09b37e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterData.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupType; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,22 +52,20 @@ /** * Object with data to fill browser filter */ -@ApiModel(description = "Object with data to fill browser filter") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupBrowserFilterData { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces = null; + private List namespaces = new ArrayList<>(); public static final String SERIALIZED_NAME_GROUP_TYPES = "group_types"; @SerializedName(SERIALIZED_NAME_GROUP_TYPES) - private List groupTypes = null; + private List groupTypes = new ArrayList<>(); - public GroupBrowserFilterData() { + public GroupBrowserFilterData() { } public GroupBrowserFilterData namespaces(List namespaces) { - this.namespaces = namespaces; return this; } @@ -71,25 +78,21 @@ public GroupBrowserFilterData addNamespacesItem(String namespacesItem) { return this; } - /** + /** * list of all unique namespaces to display * @return namespaces - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of all unique namespaces to display") - public List getNamespaces() { return namespaces; } - public void setNamespaces(List namespaces) { this.namespaces = namespaces; } public GroupBrowserFilterData groupTypes(List groupTypes) { - this.groupTypes = groupTypes; return this; } @@ -102,57 +105,19 @@ public GroupBrowserFilterData addGroupTypesItem(GroupType groupTypesItem) { return this; } - /** + /** * list of all available group types to display * @return groupTypes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of all available group types to display") - public List getGroupTypes() { return groupTypes; } - public void setGroupTypes(List groupTypes) { this.groupTypes = groupTypes; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupBrowserFilterData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -165,13 +130,12 @@ public boolean equals(Object o) { } GroupBrowserFilterData groupBrowserFilterData = (GroupBrowserFilterData) o; return Objects.equals(this.namespaces, groupBrowserFilterData.namespaces) && - Objects.equals(this.groupTypes, groupBrowserFilterData.groupTypes)&& - Objects.equals(this.additionalProperties, groupBrowserFilterData.additionalProperties); + Objects.equals(this.groupTypes, groupBrowserFilterData.groupTypes); } @Override public int hashCode() { - return Objects.hash(namespaces, groupTypes, additionalProperties); + return Objects.hash(namespaces, groupTypes); } @Override @@ -180,7 +144,6 @@ public String toString() { sb.append("class GroupBrowserFilterData {\n"); sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); sb.append(" groupTypes: ").append(toIndentedString(groupTypes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -210,26 +173,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupBrowserFilterData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupBrowserFilterData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupBrowserFilterData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupBrowserFilterData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupBrowserFilterData is not found in the empty JSON string", GroupBrowserFilterData.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupBrowserFilterData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupBrowserFilterData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonNull() && !jsonObj.get("namespaces").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); } - // ensure the json data is an array - if (jsonObj.get("group_types") != null && !jsonObj.get("group_types").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("group_types") != null && !jsonObj.get("group_types").isJsonNull() && !jsonObj.get("group_types").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `group_types` to be an array in the JSON string but got `%s`", jsonObj.get("group_types").toString())); } } @@ -249,71 +219,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupBrowserFilterData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupBrowserFilterData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupBrowserFilterData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupBrowserFilterData given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupBrowserFilterData - * @throws IOException if the JSON string is invalid with respect to GroupBrowserFilterData - */ + /** + * Create an instance of GroupBrowserFilterData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupBrowserFilterData + * @throws IOException if the JSON string is invalid with respect to GroupBrowserFilterData + */ public static GroupBrowserFilterData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupBrowserFilterData.class); } - /** - * Convert an instance of GroupBrowserFilterData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupBrowserFilterData 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/model/GroupChanges.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupChanges.java index 18c1876..9868f1d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupChanges.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupChanges.java @@ -14,51 +14,58 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupMember; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * A request to change the members of a group. Contains assets to add or remove. */ -@ApiModel(description = "A request to change the members of a group. Contains assets to add or remove.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupChanges { public static final String SERIALIZED_NAME_ADD = "add"; @SerializedName(SERIALIZED_NAME_ADD) - private List add = null; + private List add = new ArrayList<>(); public static final String SERIALIZED_NAME_REMOVE = "remove"; @SerializedName(SERIALIZED_NAME_REMOVE) - private List remove = null; + private List remove = new ArrayList<>(); - public GroupChanges() { + public GroupChanges() { } public GroupChanges add(List add) { - this.add = add; return this; } @@ -71,25 +78,21 @@ public GroupChanges addAddItem(GroupMember addItem) { return this; } - /** + /** * the assets, arrays or groups, to add to the group. * @return add - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the assets, arrays or groups, to add to the group.") - public List getAdd() { return add; } - public void setAdd(List add) { this.add = add; } public GroupChanges remove(List remove) { - this.remove = remove; return this; } @@ -102,57 +105,19 @@ public GroupChanges addRemoveItem(GroupMember removeItem) { return this; } - /** + /** * the assets, arrays or groups, to remove from the group. * @return remove - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the assets, arrays or groups, to remove from the group.") - public List getRemove() { return remove; } - public void setRemove(List remove) { this.remove = remove; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupChanges putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -165,13 +130,12 @@ public boolean equals(Object o) { } GroupChanges groupChanges = (GroupChanges) o; return Objects.equals(this.add, groupChanges.add) && - Objects.equals(this.remove, groupChanges.remove)&& - Objects.equals(this.additionalProperties, groupChanges.additionalProperties); + Objects.equals(this.remove, groupChanges.remove); } @Override public int hashCode() { - return Objects.hash(add, remove, additionalProperties); + return Objects.hash(add, remove); } @Override @@ -180,7 +144,6 @@ public String toString() { sb.append("class GroupChanges {\n"); sb.append(" add: ").append(toIndentedString(add)).append("\n"); sb.append(" remove: ").append(toIndentedString(remove)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -210,43 +173,54 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupChanges - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupChanges.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupChanges + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupChanges.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupChanges is not found in the empty JSON string", GroupChanges.openapiRequiredFields.toString())); } } - JsonArray jsonArrayadd = jsonObj.getAsJsonArray("add"); - if (jsonArrayadd != null) { - // ensure the json data is an array - if (!jsonObj.get("add").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `add` to be an array in the JSON string but got `%s`", jsonObj.get("add").toString())); - } - // validate the optional field `add` (array) - for (int i = 0; i < jsonArrayadd.size(); i++) { - GroupMember.validateJsonObject(jsonArrayadd.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupChanges.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupChanges` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } } - JsonArray jsonArrayremove = jsonObj.getAsJsonArray("remove"); - if (jsonArrayremove != null) { - // ensure the json data is an array - if (!jsonObj.get("remove").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `remove` to be an array in the JSON string but got `%s`", jsonObj.get("remove").toString())); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("add") != null && !jsonObj.get("add").isJsonNull()) { + JsonArray jsonArrayadd = jsonObj.getAsJsonArray("add"); + if (jsonArrayadd != null) { + // ensure the json data is an array + if (!jsonObj.get("add").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `add` to be an array in the JSON string but got `%s`", jsonObj.get("add").toString())); + } + + // validate the optional field `add` (array) + for (int i = 0; i < jsonArrayadd.size(); i++) { + GroupMember.validateJsonElement(jsonArrayadd.get(i)); + }; + } + } + if (jsonObj.get("remove") != null && !jsonObj.get("remove").isJsonNull()) { + JsonArray jsonArrayremove = jsonObj.getAsJsonArray("remove"); + if (jsonArrayremove != null) { + // ensure the json data is an array + if (!jsonObj.get("remove").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `remove` to be an array in the JSON string but got `%s`", jsonObj.get("remove").toString())); + } + + // validate the optional field `remove` (array) + for (int i = 0; i < jsonArrayremove.size(); i++) { + GroupMember.validateJsonElement(jsonArrayremove.get(i)); + }; } - - // validate the optional field `remove` (array) - for (int i = 0; i < jsonArrayremove.size(); i++) { - GroupMember.validateJsonObject(jsonArrayremove.get(i).getAsJsonObject()); - }; } } @@ -265,71 +239,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupChanges value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupChanges read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupChanges instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupChanges given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupChanges - * @throws IOException if the JSON string is invalid with respect to GroupChanges - */ + /** + * Create an instance of GroupChanges given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupChanges + * @throws IOException if the JSON string is invalid with respect to GroupChanges + */ public static GroupChanges fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupChanges.class); } - /** - * Convert an instance of GroupChanges to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupChanges 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/model/GroupContentActivity.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivity.java index e50e4cc..afc814d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivity.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivity.java @@ -14,26 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActivityLog; +import io.tiledb.cloud.rest_api.model.GroupContentActivityAsset; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +51,7 @@ /** * Object containing activity of an asset of a group */ -@ApiModel(description = "Object containing activity of an asset of a group") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupContentActivity { public static final String SERIALIZED_NAME_ASSET = "asset"; @SerializedName(SERIALIZED_NAME_ASSET) @@ -52,89 +61,46 @@ public class GroupContentActivity { @SerializedName(SERIALIZED_NAME_ACTIVITY_LOG) private ArrayActivityLog activityLog; - public GroupContentActivity() { + public GroupContentActivity() { } public GroupContentActivity asset(GroupContentActivityAsset asset) { - this.asset = asset; return this; } - /** + /** * Get asset * @return asset - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public GroupContentActivityAsset getAsset() { return asset; } - public void setAsset(GroupContentActivityAsset asset) { this.asset = asset; } public GroupContentActivity activityLog(ArrayActivityLog activityLog) { - this.activityLog = activityLog; return this; } - /** + /** * Get activityLog * @return activityLog - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayActivityLog getActivityLog() { return activityLog; } - public void setActivityLog(ArrayActivityLog activityLog) { this.activityLog = activityLog; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupContentActivity putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -147,13 +113,12 @@ public boolean equals(Object o) { } GroupContentActivity groupContentActivity = (GroupContentActivity) o; return Objects.equals(this.asset, groupContentActivity.asset) && - Objects.equals(this.activityLog, groupContentActivity.activityLog)&& - Objects.equals(this.additionalProperties, groupContentActivity.additionalProperties); + Objects.equals(this.activityLog, groupContentActivity.activityLog); } @Override public int hashCode() { - return Objects.hash(asset, activityLog, additionalProperties); + return Objects.hash(asset, activityLog); } @Override @@ -162,7 +127,6 @@ public String toString() { sb.append("class GroupContentActivity {\n"); sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); sb.append(" activityLog: ").append(toIndentedString(activityLog)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,27 +156,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupContentActivity - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupContentActivity.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupContentActivity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupContentActivity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentActivity is not found in the empty JSON string", GroupContentActivity.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupContentActivity.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupContentActivity` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `asset` - if (jsonObj.getAsJsonObject("asset") != null) { - GroupContentActivityAsset.validateJsonObject(jsonObj.getAsJsonObject("asset")); + if (jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) { + GroupContentActivityAsset.validateJsonElement(jsonObj.get("asset")); } // validate the optional field `activity_log` - if (jsonObj.getAsJsonObject("activity_log") != null) { - ArrayActivityLog.validateJsonObject(jsonObj.getAsJsonObject("activity_log")); + if (jsonObj.get("activity_log") != null && !jsonObj.get("activity_log").isJsonNull()) { + ArrayActivityLog.validateJsonElement(jsonObj.get("activity_log")); } } @@ -231,71 +202,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupContentActivity value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupContentActivity read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupContentActivity instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupContentActivity given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupContentActivity - * @throws IOException if the JSON string is invalid with respect to GroupContentActivity - */ + /** + * Create an instance of GroupContentActivity given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentActivity + * @throws IOException if the JSON string is invalid with respect to GroupContentActivity + */ public static GroupContentActivity fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupContentActivity.class); } - /** - * Convert an instance of GroupContentActivity to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupContentActivity 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/model/GroupContentActivityAsset.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAsset.java index 839868e..41ccbc4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAsset.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAsset.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * The asset details */ -@ApiModel(description = "The asset details") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupContentActivityAsset { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,135 +68,84 @@ public class GroupContentActivityAsset { @SerializedName(SERIALIZED_NAME_ASSET_TYPE) private AssetType assetType; - public GroupContentActivityAsset() { + public GroupContentActivityAsset() { } public GroupContentActivityAsset id(String id) { - this.id = id; return this; } - /** + /** * The asset ID * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The asset ID") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public GroupContentActivityAsset name(String name) { - this.name = name; return this; } - /** + /** * The asset name * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The asset name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public GroupContentActivityAsset namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * The namespace that the asset belongs to * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The namespace that the asset belongs to") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public GroupContentActivityAsset assetType(AssetType assetType) { - this.assetType = assetType; return this; } - /** + /** * Get assetType * @return assetType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetType getAssetType() { return assetType; } - public void setAssetType(AssetType assetType) { this.assetType = assetType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupContentActivityAsset putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +160,12 @@ public boolean equals(Object o) { return Objects.equals(this.id, groupContentActivityAsset.id) && Objects.equals(this.name, groupContentActivityAsset.name) && Objects.equals(this.namespace, groupContentActivityAsset.namespace) && - Objects.equals(this.assetType, groupContentActivityAsset.assetType)&& - Objects.equals(this.additionalProperties, groupContentActivityAsset.additionalProperties); + Objects.equals(this.assetType, groupContentActivityAsset.assetType); } @Override public int hashCode() { - return Objects.hash(id, name, namespace, assetType, additionalProperties); + return Objects.hash(id, name, namespace, assetType); } @Override @@ -220,7 +176,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -252,29 +207,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupContentActivityAsset - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupContentActivityAsset.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupContentActivityAsset + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupContentActivityAsset.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentActivityAsset is not found in the empty JSON string", GroupContentActivityAsset.openapiRequiredFields.toString())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupContentActivityAsset.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupContentActivityAsset` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } + // validate the optional field `asset_type` + if (jsonObj.get("asset_type") != null && !jsonObj.get("asset_type").isJsonNull()) { + AssetType.validateJsonElement(jsonObj.get("asset_type")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -292,71 +258,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupContentActivityAsset value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupContentActivityAsset read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupContentActivityAsset instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupContentActivityAsset given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupContentActivityAsset - * @throws IOException if the JSON string is invalid with respect to GroupContentActivityAsset - */ + /** + * Create an instance of GroupContentActivityAsset given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentActivityAsset + * @throws IOException if the JSON string is invalid with respect to GroupContentActivityAsset + */ public static GroupContentActivityAsset fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupContentActivityAsset.class); } - /** - * Convert an instance of GroupContentActivityAsset to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupContentActivityAsset 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/model/GroupContentActivityResponse.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponse.java index 39452ba..c5556f4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponse.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponse.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupContentActivity; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Object containing activity logs of group content along with the pagination metadata */ -@ApiModel(description = "Object containing activity logs of group content along with the pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupContentActivityResponse { public static final String SERIALIZED_NAME_ACTIVITY = "activity"; @SerializedName(SERIALIZED_NAME_ACTIVITY) - private List activity = null; + private List activity = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public GroupContentActivityResponse() { + public GroupContentActivityResponse() { } public GroupContentActivityResponse activity(List activity) { - this.activity = activity; return this; } @@ -72,80 +79,38 @@ public GroupContentActivityResponse addActivityItem(GroupContentActivity activit return this; } - /** + /** * Activity of a group's content * @return activity - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Activity of a group's content") - public List getActivity() { return activity; } - public void setActivity(List activity) { this.activity = activity; } public GroupContentActivityResponse paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupContentActivityResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } GroupContentActivityResponse groupContentActivityResponse = (GroupContentActivityResponse) o; return Objects.equals(this.activity, groupContentActivityResponse.activity) && - Objects.equals(this.paginationMetadata, groupContentActivityResponse.paginationMetadata)&& - Objects.equals(this.additionalProperties, groupContentActivityResponse.additionalProperties); + Objects.equals(this.paginationMetadata, groupContentActivityResponse.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(activity, paginationMetadata, additionalProperties); + return Objects.hash(activity, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class GroupContentActivityResponse {\n"); sb.append(" activity: ").append(toIndentedString(activity)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupContentActivityResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupContentActivityResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupContentActivityResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupContentActivityResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentActivityResponse is not found in the empty JSON string", GroupContentActivityResponse.openapiRequiredFields.toString())); } } - JsonArray jsonArrayactivity = jsonObj.getAsJsonArray("activity"); - if (jsonArrayactivity != null) { - // ensure the json data is an array - if (!jsonObj.get("activity").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `activity` to be an array in the JSON string but got `%s`", jsonObj.get("activity").toString())); - } - // validate the optional field `activity` (array) - for (int i = 0; i < jsonArrayactivity.size(); i++) { - GroupContentActivity.validateJsonObject(jsonArrayactivity.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupContentActivityResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupContentActivityResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("activity") != null && !jsonObj.get("activity").isJsonNull()) { + JsonArray jsonArrayactivity = jsonObj.getAsJsonArray("activity"); + if (jsonArrayactivity != null) { + // ensure the json data is an array + if (!jsonObj.get("activity").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `activity` to be an array in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + + // validate the optional field `activity` (array) + for (int i = 0; i < jsonArrayactivity.size(); i++) { + GroupContentActivity.validateJsonElement(jsonArrayactivity.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupContentActivityResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupContentActivityResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupContentActivityResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupContentActivityResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupContentActivityResponse - * @throws IOException if the JSON string is invalid with respect to GroupContentActivityResponse - */ + /** + * Create an instance of GroupContentActivityResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentActivityResponse + * @throws IOException if the JSON string is invalid with respect to GroupContentActivityResponse + */ public static GroupContentActivityResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupContentActivityResponse.class); } - /** - * Convert an instance of GroupContentActivityResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupContentActivityResponse 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/model/GroupContents.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContents.java index fd39ae7..20e8e37 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupContents.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContents.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupEntry; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Object including a page of members of a group and pagination metadata */ -@ApiModel(description = "Object including a page of members of a group and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupContents { public static final String SERIALIZED_NAME_ENTRIES = "entries"; @SerializedName(SERIALIZED_NAME_ENTRIES) - private List entries = null; + private List entries = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public GroupContents() { + public GroupContents() { } public GroupContents entries(List entries) { - this.entries = entries; return this; } @@ -72,80 +79,38 @@ public GroupContents addEntriesItem(GroupEntry entriesItem) { return this; } - /** + /** * Groups members * @return entries - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Groups members") - public List getEntries() { return entries; } - public void setEntries(List entries) { this.entries = entries; } public GroupContents paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupContents putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } GroupContents groupContents = (GroupContents) o; return Objects.equals(this.entries, groupContents.entries) && - Objects.equals(this.paginationMetadata, groupContents.paginationMetadata)&& - Objects.equals(this.additionalProperties, groupContents.additionalProperties); + Objects.equals(this.paginationMetadata, groupContents.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(entries, paginationMetadata, additionalProperties); + return Objects.hash(entries, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class GroupContents {\n"); sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupContents - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupContents.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupContents + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupContents.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContents is not found in the empty JSON string", GroupContents.openapiRequiredFields.toString())); } } - JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); - if (jsonArrayentries != null) { - // ensure the json data is an array - 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())); - } - // validate the optional field `entries` (array) - for (int i = 0; i < jsonArrayentries.size(); i++) { - GroupEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupContents.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupContents` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + GroupEntry.validateJsonElement(jsonArrayentries.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupContents value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupContents read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupContents instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupContents given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupContents - * @throws IOException if the JSON string is invalid with respect to GroupContents - */ + /** + * Create an instance of GroupContents given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContents + * @throws IOException if the JSON string is invalid with respect to GroupContents + */ public static GroupContents fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupContents.class); } - /** - * Convert an instance of GroupContents to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupContents 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/model/GroupContentsFilterData.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterData.java index afc9df6..a601223 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterData.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,18 +51,16 @@ /** * Object with data to fill contents filter */ -@ApiModel(description = "Object with data to fill contents filter") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupContentsFilterData { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces = null; + private List namespaces = new ArrayList<>(); - public GroupContentsFilterData() { + public GroupContentsFilterData() { } public GroupContentsFilterData namespaces(List namespaces) { - this.namespaces = namespaces; return this; } @@ -67,57 +73,19 @@ public GroupContentsFilterData addNamespacesItem(String namespacesItem) { return this; } - /** + /** * list of all unique namespaces to display * @return namespaces - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of all unique namespaces to display") - public List getNamespaces() { return namespaces; } - public void setNamespaces(List namespaces) { this.namespaces = namespaces; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupContentsFilterData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -129,13 +97,12 @@ public boolean equals(Object o) { return false; } GroupContentsFilterData groupContentsFilterData = (GroupContentsFilterData) o; - return Objects.equals(this.namespaces, groupContentsFilterData.namespaces)&& - Objects.equals(this.additionalProperties, groupContentsFilterData.additionalProperties); + return Objects.equals(this.namespaces, groupContentsFilterData.namespaces); } @Override public int hashCode() { - return Objects.hash(namespaces, additionalProperties); + return Objects.hash(namespaces); } @Override @@ -143,7 +110,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GroupContentsFilterData {\n"); sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -172,22 +138,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupContentsFilterData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupContentsFilterData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupContentsFilterData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupContentsFilterData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentsFilterData is not found in the empty JSON string", GroupContentsFilterData.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupContentsFilterData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupContentsFilterData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonNull() && !jsonObj.get("namespaces").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); } } @@ -207,71 +180,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupContentsFilterData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupContentsFilterData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupContentsFilterData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupContentsFilterData given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupContentsFilterData - * @throws IOException if the JSON string is invalid with respect to GroupContentsFilterData - */ + /** + * Create an instance of GroupContentsFilterData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentsFilterData + * @throws IOException if the JSON string is invalid with respect to GroupContentsFilterData + */ public static GroupContentsFilterData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupContentsFilterData.class); } - /** - * Convert an instance of GroupContentsFilterData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupContentsFilterData 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/model/GroupCreate.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupCreate.java index 0530fe9..a5fae01 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupCreate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupCreate.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * Initial attributes for the creation of a group. */ -@ApiModel(description = "Initial attributes for the creation of a group.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupCreate { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -72,7 +79,7 @@ public class GroupCreate { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; @SerializedName(SERIALIZED_NAME_LICENSE_ID) @@ -82,149 +89,124 @@ public class GroupCreate { @SerializedName(SERIALIZED_NAME_LICENSE_TEXT) private String licenseText; - public GroupCreate() { + public GroupCreate() { } public GroupCreate description(String description) { - this.description = description; return this; } - /** + /** * A human readable description of the contents of the group. * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A human readable description of the contents of the group.") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public GroupCreate name(String name) { - this.name = name; return this; } - /** + /** * The name of the group. If must be unique within the group. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group. If must be unique within the group.") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public GroupCreate parent(String parent) { - this.parent = parent; return this; } - /** + /** * The unique name or id of the parent of the group. If empty, then the new group will be a top level group. * @return parent - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The unique name or id of the parent of the group. If empty, then the new group will be a top level group.") - public String getParent() { return parent; } - public void setParent(String parent) { this.parent = parent; } public GroupCreate uri(String uri) { - this.uri = uri; return this; } - /** + /** * uri of group. * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "uri of group.") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public GroupCreate logo(String logo) { - this.logo = logo; return this; } - /** + /** * logo (base64 encoded) for the group. Optional * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logo (base64 encoded) for the group. Optional") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public GroupCreate accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * the name of the access credentials to use. if unset, the default credentials will be used. * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used.") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public GroupCreate tags(List tags) { - this.tags = tags; return this; } @@ -237,103 +219,57 @@ public GroupCreate addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for groups. * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for groups.") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public GroupCreate licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom. * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom.") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public GroupCreate licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupCreate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -353,13 +289,12 @@ public boolean equals(Object o) { Objects.equals(this.accessCredentialsName, groupCreate.accessCredentialsName) && Objects.equals(this.tags, groupCreate.tags) && Objects.equals(this.licenseId, groupCreate.licenseId) && - Objects.equals(this.licenseText, groupCreate.licenseText)&& - Objects.equals(this.additionalProperties, groupCreate.additionalProperties); + Objects.equals(this.licenseText, groupCreate.licenseText); } @Override public int hashCode() { - return Objects.hash(description, name, parent, uri, logo, accessCredentialsName, tags, licenseId, licenseText, additionalProperties); + return Objects.hash(description, name, parent, uri, logo, accessCredentialsName, tags, licenseId, licenseText); } @Override @@ -375,7 +310,6 @@ public String toString() { sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -412,46 +346,53 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupCreate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupCreate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupCreate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupCreate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupCreate is not found in the empty JSON string", GroupCreate.openapiRequiredFields.toString())); } } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupCreate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupCreate` 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("parent") != null && !jsonObj.get("parent").isJsonPrimitive()) { + if ((jsonObj.get("parent") != null && !jsonObj.get("parent").isJsonNull()) && !jsonObj.get("parent").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `parent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parent").toString())); } - if (jsonObj.get("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + 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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } } @@ -471,71 +412,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupCreate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupCreate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupCreate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupCreate given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupCreate - * @throws IOException if the JSON string is invalid with respect to GroupCreate - */ + /** + * Create an instance of GroupCreate given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupCreate + * @throws IOException if the JSON string is invalid with respect to GroupCreate + */ public static GroupCreate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupCreate.class); } - /** - * Convert an instance of GroupCreate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupCreate 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/model/GroupEntry.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupEntry.java index cfd54f3..3ebbb26 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupEntry.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupEntry.java @@ -14,26 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.GroupInfo; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +51,7 @@ /** * Object describing a single member of a group, which can be an array or a group */ -@ApiModel(description = "Object describing a single member of a group, which can be an array or a group") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupEntry { public static final String SERIALIZED_NAME_MEMBER_ID = "member_id"; @SerializedName(SERIALIZED_NAME_MEMBER_ID) @@ -56,10 +65,9 @@ public class GroupEntry { @SerializedName(SERIALIZED_NAME_ARRAY) private ArrayInfo array; - public GroupEntry() { + public GroupEntry() { } - public GroupEntry( String memberId ) { @@ -67,100 +75,54 @@ public GroupEntry( this.memberId = memberId; } - /** + /** * The unique member id for the entry * @return memberId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The unique member id for the entry") - public String getMemberId() { return memberId; } - public GroupEntry group(GroupInfo group) { - this.group = group; return this; } - /** + /** * Get group * @return group - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public GroupInfo getGroup() { return group; } - public void setGroup(GroupInfo group) { this.group = group; } public GroupEntry array(ArrayInfo array) { - this.array = array; return this; } - /** + /** * Get array * @return array - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayInfo getArray() { return array; } - public void setArray(ArrayInfo array) { this.array = array; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupEntry putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -174,13 +136,12 @@ public boolean equals(Object o) { GroupEntry groupEntry = (GroupEntry) o; return Objects.equals(this.memberId, groupEntry.memberId) && Objects.equals(this.group, groupEntry.group) && - Objects.equals(this.array, groupEntry.array)&& - Objects.equals(this.additionalProperties, groupEntry.additionalProperties); + Objects.equals(this.array, groupEntry.array); } @Override public int hashCode() { - return Objects.hash(memberId, group, array, additionalProperties); + return Objects.hash(memberId, group, array); } @Override @@ -190,7 +151,6 @@ public String toString() { sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); sb.append(" group: ").append(toIndentedString(group)).append("\n"); sb.append(" array: ").append(toIndentedString(array)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -221,30 +181,37 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupEntry - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupEntry.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupEntry is not found in the empty JSON string", GroupEntry.openapiRequiredFields.toString())); } } - if (jsonObj.get("member_id") != null && !jsonObj.get("member_id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupEntry` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("member_id") != null && !jsonObj.get("member_id").isJsonNull()) && !jsonObj.get("member_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `member_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("member_id").toString())); } // validate the optional field `group` - if (jsonObj.getAsJsonObject("group") != null) { - GroupInfo.validateJsonObject(jsonObj.getAsJsonObject("group")); + if (jsonObj.get("group") != null && !jsonObj.get("group").isJsonNull()) { + GroupInfo.validateJsonElement(jsonObj.get("group")); } // validate the optional field `array` - if (jsonObj.getAsJsonObject("array") != null) { - ArrayInfo.validateJsonObject(jsonObj.getAsJsonObject("array")); + if (jsonObj.get("array") != null && !jsonObj.get("array").isJsonNull()) { + ArrayInfo.validateJsonElement(jsonObj.get("array")); } } @@ -263,71 +230,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupEntry value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupEntry read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupEntry instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupEntry given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupEntry - * @throws IOException if the JSON string is invalid with respect to GroupEntry - */ + /** + * Create an instance of GroupEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupEntry + * @throws IOException if the JSON string is invalid with respect to GroupEntry + */ public static GroupEntry fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupEntry.class); } - /** - * Convert an instance of GroupEntry to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupEntry 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/model/GroupInfo.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupInfo.java index d5fc4ae..ac7011e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupInfo.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupInfo.java @@ -14,33 +14,42 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupActions; +import io.tiledb.cloud.rest_api.model.GroupType; +import io.tiledb.cloud.rest_api.model.MetadataStringifiedEntry; import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -48,8 +57,7 @@ /** * metadata of a group */ -@ApiModel(description = "metadata of a group") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupInfo { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -93,7 +101,7 @@ public class GroupInfo { public static final String SERIALIZED_NAME_ALLOWED_ACTIONS = "allowed_actions"; @SerializedName(SERIALIZED_NAME_ALLOWED_ACTIONS) - private List allowedActions = null; + private List allowedActions = new ArrayList<>(); public static final String SERIALIZED_NAME_GROUP_TYPE = "group_type"; @SerializedName(SERIALIZED_NAME_GROUP_TYPE) @@ -117,7 +125,7 @@ public class GroupInfo { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; @SerializedName(SERIALIZED_NAME_LICENSE_ID) @@ -137,243 +145,202 @@ public class GroupInfo { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private List metadata = null; + private List metadata = new ArrayList<>(); - public GroupInfo() { + public GroupInfo() { } public GroupInfo id(String id) { - this.id = id; return this; } - /** + /** * unique ID of registered group * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of registered group") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public GroupInfo namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace group is in * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "user1", value = "namespace group is in") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public GroupInfo name(String name) { - this.name = name; return this; } - /** + /** * name of group * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "myarray1", value = "name of group") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public GroupInfo description(String description) { - this.description = description; return this; } - /** + /** * description of group * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "description of group") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public GroupInfo uri(String uri) { - this.uri = uri; return this; } - /** + /** * uri of group * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "s3://bucket/asset", value = "uri of group") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public GroupInfo tiledbUri(String tiledbUri) { - this.tiledbUri = tiledbUri; return this; } - /** + /** * uri for access through TileDB cloud * @return tiledbUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "uri for access through TileDB cloud") - public String getTiledbUri() { return tiledbUri; } - public void setTiledbUri(String tiledbUri) { this.tiledbUri = tiledbUri; } public GroupInfo assetCount(BigDecimal assetCount) { - this.assetCount = assetCount; return this; } - /** + /** * A count of direct array members * @return assetCount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "12.0", value = "A count of direct array members") - public BigDecimal getAssetCount() { return assetCount; } - public void setAssetCount(BigDecimal assetCount) { this.assetCount = assetCount; } public GroupInfo groupCount(BigDecimal groupCount) { - this.groupCount = groupCount; return this; } - /** + /** * A count of direct group members * @return groupCount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "4.0", value = "A count of direct group members") - public BigDecimal getGroupCount() { return groupCount; } - public void setGroupCount(BigDecimal groupCount) { this.groupCount = groupCount; } public GroupInfo size(BigDecimal size) { - this.size = size; return this; } - /** + /** * A count of direct members. This is the sum of asset_count and group_count * @return size - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "16.0", value = "A count of direct members. This is the sum of asset_count and group_count") - public BigDecimal getSize() { return size; } - public void setSize(BigDecimal size) { this.size = size; } public GroupInfo lastAccessed(OffsetDateTime lastAccessed) { - this.lastAccessed = lastAccessed; return this; } - /** + /** * Datetime groups was last accessed in UTC * @return lastAccessed - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime groups was last accessed in UTC") - public OffsetDateTime getLastAccessed() { return lastAccessed; } - public void setLastAccessed(OffsetDateTime lastAccessed) { this.lastAccessed = lastAccessed; } public GroupInfo allowedActions(List allowedActions) { - this.allowedActions = allowedActions; return this; } @@ -386,140 +353,116 @@ public GroupInfo addAllowedActionsItem(GroupActions allowedActionsItem) { return this; } - /** + /** * list of actions user is allowed to do on this group * @return allowedActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of actions user is allowed to do on this group") - public List getAllowedActions() { return allowedActions; } - public void setAllowedActions(List allowedActions) { this.allowedActions = allowedActions; } public GroupInfo groupType(GroupType groupType) { - this.groupType = groupType; return this; } - /** + /** * Get groupType * @return groupType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public GroupType getGroupType() { return groupType; } - public void setGroupType(GroupType groupType) { this.groupType = groupType; } public GroupInfo logo(String logo) { - this.logo = logo; return this; } - /** + /** * logo (base64 encoded) for the gruop. Optional * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logo (base64 encoded) for the gruop. Optional") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public GroupInfo accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * the name of the access credentials to use. if unset, the default credentials will be used * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public GroupInfo shareCount(BigDecimal shareCount) { - this.shareCount = shareCount; return this; } - /** + /** * number of unique namespaces this group is shared with * @return shareCount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "number of unique namespaces this group is shared with") - public BigDecimal getShareCount() { return shareCount; } - public void setShareCount(BigDecimal shareCount) { this.shareCount = shareCount; } public GroupInfo publicShare(Boolean publicShare) { - this.publicShare = publicShare; return this; } - /** + /** * Suggests if the group was shared to public by owner * @return publicShare - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Suggests if the group was shared to public by owner") - public Boolean getPublicShare() { return publicShare; } - public void setPublicShare(Boolean publicShare) { this.publicShare = publicShare; } public GroupInfo tags(List tags) { - this.tags = tags; return this; } @@ -532,117 +475,97 @@ public GroupInfo addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for group * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for group") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public GroupInfo licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public GroupInfo licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } public GroupInfo createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } - /** + /** * Datetime the group was registered with tiledb * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime the group was registered with tiledb") - public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } public GroupInfo createdBy(String createdBy) { - this.createdBy = createdBy; return this; } - /** + /** * The username of the group's creator, if known. * @return createdBy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The username of the group's creator, if known.") - public String getCreatedBy() { return createdBy; } - public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public GroupInfo metadata(List metadata) { - this.metadata = metadata; return this; } @@ -655,57 +578,19 @@ public GroupInfo addMetadataItem(MetadataStringifiedEntry metadataItem) { return this; } - /** + /** * Contains metadata of the group. **Note:** This property is included in the response only if the `with_metadata` query parameter is set to `true`. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Contains metadata of the group. **Note:** This property is included in the response only if the `with_metadata` query parameter is set to `true`. ") - public List getMetadata() { return metadata; } - public void setMetadata(List metadata) { this.metadata = metadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupInfo putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -738,8 +623,7 @@ public boolean equals(Object o) { Objects.equals(this.licenseText, groupInfo.licenseText) && Objects.equals(this.createdAt, groupInfo.createdAt) && Objects.equals(this.createdBy, groupInfo.createdBy) && - Objects.equals(this.metadata, groupInfo.metadata)&& - Objects.equals(this.additionalProperties, groupInfo.additionalProperties); + Objects.equals(this.metadata, groupInfo.metadata); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -748,7 +632,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, namespace, name, description, uri, tiledbUri, assetCount, groupCount, size, lastAccessed, allowedActions, groupType, logo, accessCredentialsName, shareCount, publicShare, tags, licenseId, licenseText, createdAt, createdBy, metadata, additionalProperties); + return Objects.hash(id, namespace, name, description, uri, tiledbUri, assetCount, groupCount, size, lastAccessed, allowedActions, groupType, logo, accessCredentialsName, shareCount, publicShare, tags, licenseId, licenseText, createdAt, createdBy, metadata); } private static int hashCodeNullable(JsonNullable a) { @@ -784,7 +668,6 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -834,72 +717,85 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + 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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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").isJsonPrimitive()) { + 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("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + 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") != null && !jsonObj.get("tiledb_uri").isJsonPrimitive()) { + if ((jsonObj.get("tiledb_uri") != null && !jsonObj.get("tiledb_uri").isJsonNull()) && !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())); } - // ensure the json data is an array - if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonNull() && !jsonObj.get("allowed_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `allowed_actions` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_actions").toString())); } - if (jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + // validate the optional field `group_type` + if (jsonObj.get("group_type") != null && !jsonObj.get("group_type").isJsonNull()) { + GroupType.validateJsonElement(jsonObj.get("group_type")); + } + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } - if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonPrimitive()) { + if ((jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) && !jsonObj.get("created_by").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `created_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_by").toString())); } - 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())); + 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++) { + MetadataStringifiedEntry.validateJsonElement(jsonArraymetadata.get(i)); + }; } - - // validate the optional field `metadata` (array) - for (int i = 0; i < jsonArraymetadata.size(); i++) { - MetadataStringifiedEntry.validateJsonObject(jsonArraymetadata.get(i).getAsJsonObject()); - }; } } @@ -918,71 +814,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/GroupMember.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupMember.java index 933152e..060cde5 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupMember.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupMember.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.GroupMemberType; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * A groups member, array or another groups, to add or remove from an existing group. */ -@ApiModel(description = "A groups member, array or another groups, to add or remove from an existing group.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupMember { public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -56,112 +64,65 @@ public class GroupMember { @SerializedName(SERIALIZED_NAME_MEMBER_TYPE) private GroupMemberType memberType; - public GroupMember() { + public GroupMember() { } public GroupMember namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * The namespace of the asset. * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The namespace of the asset.") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public GroupMember name(String name) { - this.name = name; return this; } - /** + /** * The name or id of the asset. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name or id of the asset.") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public GroupMember memberType(GroupMemberType memberType) { - this.memberType = memberType; return this; } - /** + /** * Get memberType * @return memberType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public GroupMemberType getMemberType() { return memberType; } - public void setMemberType(GroupMemberType memberType) { this.memberType = memberType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupMember putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +136,12 @@ public boolean equals(Object o) { GroupMember groupMember = (GroupMember) o; return Objects.equals(this.namespace, groupMember.namespace) && Objects.equals(this.name, groupMember.name) && - Objects.equals(this.memberType, groupMember.memberType)&& - Objects.equals(this.additionalProperties, groupMember.additionalProperties); + Objects.equals(this.memberType, groupMember.memberType); } @Override public int hashCode() { - return Objects.hash(namespace, name, memberType, additionalProperties); + return Objects.hash(namespace, name, memberType); } @Override @@ -191,7 +151,6 @@ public String toString() { sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" memberType: ").append(toIndentedString(memberType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,26 +181,37 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupMember - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupMember.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupMember + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupMember.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupMember is not found in the empty JSON string", GroupMember.openapiRequiredFields.toString())); } } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupMember.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupMember` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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 `member_type` + if (jsonObj.get("member_type") != null && !jsonObj.get("member_type").isJsonNull()) { + GroupMemberType.validateJsonElement(jsonObj.get("member_type")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -259,71 +229,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupMember value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupMember read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupMember instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupMember given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupMember - * @throws IOException if the JSON string is invalid with respect to GroupMember - */ + /** + * Create an instance of GroupMember given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupMember + * @throws IOException if the JSON string is invalid with respect to GroupMember + */ public static GroupMember fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupMember.class); } - /** - * Convert an instance of GroupMember to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupMember 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/model/GroupMemberAssetType.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetType.java index 66ece8e..f988171 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -92,5 +93,10 @@ public GroupMemberAssetType read(final JsonReader jsonReader) throws IOException return GroupMemberAssetType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GroupMemberAssetType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberType.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberType.java index ea33d41..67ddcf1 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupMemberType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public GroupMemberType read(final JsonReader jsonReader) throws IOException { return GroupMemberType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GroupMemberType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/GroupRegister.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupRegister.java index 4f49501..7da7da6 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupRegister.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupRegister.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * Initial attributes for the registration of a an existing group. */ -@ApiModel(description = "Initial attributes for the registration of a an existing group.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupRegister { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -72,7 +79,7 @@ public class GroupRegister { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; @SerializedName(SERIALIZED_NAME_LICENSE_ID) @@ -82,149 +89,124 @@ public class GroupRegister { @SerializedName(SERIALIZED_NAME_LICENSE_TEXT) private String licenseText; - public GroupRegister() { + public GroupRegister() { } public GroupRegister description(String description) { - this.description = description; return this; } - /** + /** * A human readable description of the contents of the group. * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A human readable description of the contents of the group.") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public GroupRegister name(String name) { - this.name = name; return this; } - /** + /** * The name of the group. If must be unique within the group. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group. If must be unique within the group.") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public GroupRegister parent(String parent) { - this.parent = parent; return this; } - /** + /** * The unique name or id of the parent of the group. If empty, then the new group will be a top level group. * @return parent - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The unique name or id of the parent of the group. If empty, then the new group will be a top level group.") - public String getParent() { return parent; } - public void setParent(String parent) { this.parent = parent; } public GroupRegister uri(String uri) { - this.uri = uri; return this; } - /** + /** * uri of group. * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "uri of group.") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public GroupRegister logo(String logo) { - this.logo = logo; return this; } - /** + /** * logo (base64 encoded) for the group. Optional * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logo (base64 encoded) for the group. Optional") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public GroupRegister accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * the name of the access credentials to use. if unset, the default credentials will be used. * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used.") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public GroupRegister tags(List tags) { - this.tags = tags; return this; } @@ -237,103 +219,57 @@ public GroupRegister addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for groups. * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for groups.") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public GroupRegister licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom. * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom.") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public GroupRegister licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupRegister putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -353,13 +289,12 @@ public boolean equals(Object o) { Objects.equals(this.accessCredentialsName, groupRegister.accessCredentialsName) && Objects.equals(this.tags, groupRegister.tags) && Objects.equals(this.licenseId, groupRegister.licenseId) && - Objects.equals(this.licenseText, groupRegister.licenseText)&& - Objects.equals(this.additionalProperties, groupRegister.additionalProperties); + Objects.equals(this.licenseText, groupRegister.licenseText); } @Override public int hashCode() { - return Objects.hash(description, name, parent, uri, logo, accessCredentialsName, tags, licenseId, licenseText, additionalProperties); + return Objects.hash(description, name, parent, uri, logo, accessCredentialsName, tags, licenseId, licenseText); } @Override @@ -375,7 +310,6 @@ public String toString() { sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -412,46 +346,53 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupRegister - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupRegister.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupRegister + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupRegister.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupRegister is not found in the empty JSON string", GroupRegister.openapiRequiredFields.toString())); } } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupRegister.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupRegister` 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("parent") != null && !jsonObj.get("parent").isJsonPrimitive()) { + if ((jsonObj.get("parent") != null && !jsonObj.get("parent").isJsonNull()) && !jsonObj.get("parent").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `parent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parent").toString())); } - if (jsonObj.get("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + 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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } } @@ -471,71 +412,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupRegister value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupRegister read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupRegister instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupRegister given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupRegister - * @throws IOException if the JSON string is invalid with respect to GroupRegister - */ + /** + * Create an instance of GroupRegister given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupRegister + * @throws IOException if the JSON string is invalid with respect to GroupRegister + */ public static GroupRegister fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupRegister.class); } - /** - * Convert an instance of GroupRegister to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupRegister 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/model/GroupSharing.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupSharing.java index d125a37..91d7fa8 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupSharing.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupSharing.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.GroupActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,16 +53,15 @@ /** * sharing state of a group with a namespace */ -@ApiModel(description = "sharing state of a group with a namespace") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupSharing { public static final String SERIALIZED_NAME_GROUP_ACTIONS = "group_actions"; @SerializedName(SERIALIZED_NAME_GROUP_ACTIONS) - private List groupActions = null; + private List groupActions = new ArrayList<>(); public static final String SERIALIZED_NAME_ARRAY_ACTIONS = "array_actions"; @SerializedName(SERIALIZED_NAME_ARRAY_ACTIONS) - private List arrayActions = null; + private List arrayActions = new ArrayList<>(); public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -62,11 +71,10 @@ public class GroupSharing { @SerializedName(SERIALIZED_NAME_NAMESPACE_TYPE) private String namespaceType; - public GroupSharing() { + public GroupSharing() { } public GroupSharing groupActions(List groupActions) { - this.groupActions = groupActions; return this; } @@ -79,25 +87,21 @@ public GroupSharing addGroupActionsItem(GroupActions groupActionsItem) { return this; } - /** + /** * List of permitted actions for the group and all subgroups * @return groupActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[read, write]", value = "List of permitted actions for the group and all subgroups") - public List getGroupActions() { return groupActions; } - public void setGroupActions(List groupActions) { this.groupActions = groupActions; } public GroupSharing arrayActions(List arrayActions) { - this.arrayActions = arrayActions; return this; } @@ -110,103 +114,57 @@ public GroupSharing addArrayActionsItem(ArrayActions arrayActionsItem) { return this; } - /** + /** * List of permitted actions for all the subarrays of the group * @return arrayActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[read, write]", value = "List of permitted actions for all the subarrays of the group") - public List getArrayActions() { return arrayActions; } - public void setArrayActions(List arrayActions) { this.arrayActions = arrayActions; } public GroupSharing namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace being granted group access can be a user or organization * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "MyOrganization", value = "namespace being granted group access can be a user or organization") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public GroupSharing namespaceType(String namespaceType) { - this.namespaceType = namespaceType; return this; } - /** + /** * details on if the namespace is a organization or user * @return namespaceType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "organization", value = "details on if the namespace is a organization or user") - public String getNamespaceType() { return namespaceType; } - public void setNamespaceType(String namespaceType) { this.namespaceType = namespaceType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupSharing putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -221,13 +179,12 @@ public boolean equals(Object o) { return Objects.equals(this.groupActions, groupSharing.groupActions) && Objects.equals(this.arrayActions, groupSharing.arrayActions) && Objects.equals(this.namespace, groupSharing.namespace) && - Objects.equals(this.namespaceType, groupSharing.namespaceType)&& - Objects.equals(this.additionalProperties, groupSharing.additionalProperties); + Objects.equals(this.namespaceType, groupSharing.namespaceType); } @Override public int hashCode() { - return Objects.hash(groupActions, arrayActions, namespace, namespaceType, additionalProperties); + return Objects.hash(groupActions, arrayActions, namespace, namespaceType); } @Override @@ -238,7 +195,6 @@ public String toString() { sb.append(" arrayActions: ").append(toIndentedString(arrayActions)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" namespaceType: ").append(toIndentedString(namespaceType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -270,32 +226,39 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupSharing - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupSharing.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupSharing + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupSharing.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupSharing is not found in the empty JSON string", GroupSharing.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupSharing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupSharing` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonNull() && !jsonObj.get("group_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `group_actions` to be an array in the JSON string but got `%s`", jsonObj.get("group_actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("array_actions") != null && !jsonObj.get("array_actions").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_actions") != null && !jsonObj.get("array_actions").isJsonNull() && !jsonObj.get("array_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_actions` to be an array in the JSON string but got `%s`", jsonObj.get("array_actions").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonPrimitive()) { + if ((jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonNull()) && !jsonObj.get("namespace_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_type").toString())); } } @@ -315,71 +278,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupSharing value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupSharing read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupSharing instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupSharing given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupSharing - * @throws IOException if the JSON string is invalid with respect to GroupSharing - */ + /** + * Create an instance of GroupSharing given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupSharing + * @throws IOException if the JSON string is invalid with respect to GroupSharing + */ public static GroupSharing fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupSharing.class); } - /** - * Convert an instance of GroupSharing to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupSharing 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/model/GroupSharingRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupSharingRequest.java index 5263268..cae3904 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupSharingRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupSharingRequest.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.GroupActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,26 +53,24 @@ /** * a request to share a group and all the contents with a namespace */ -@ApiModel(description = "a request to share a group and all the contents with a namespace") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupSharingRequest { public static final String SERIALIZED_NAME_GROUP_ACTIONS = "group_actions"; @SerializedName(SERIALIZED_NAME_GROUP_ACTIONS) - private List groupActions = null; + private List groupActions = new ArrayList<>(); public static final String SERIALIZED_NAME_ARRAY_ACTIONS = "array_actions"; @SerializedName(SERIALIZED_NAME_ARRAY_ACTIONS) - private List arrayActions = null; + private List arrayActions = new ArrayList<>(); public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) private String namespace; - public GroupSharingRequest() { + public GroupSharingRequest() { } public GroupSharingRequest groupActions(List groupActions) { - this.groupActions = groupActions; return this; } @@ -75,25 +83,21 @@ public GroupSharingRequest addGroupActionsItem(GroupActions groupActionsItem) { return this; } - /** + /** * List of permitted actions for the group and all subgroups * @return groupActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[read, write]", value = "List of permitted actions for the group and all subgroups") - public List getGroupActions() { return groupActions; } - public void setGroupActions(List groupActions) { this.groupActions = groupActions; } public GroupSharingRequest arrayActions(List arrayActions) { - this.arrayActions = arrayActions; return this; } @@ -106,80 +110,38 @@ public GroupSharingRequest addArrayActionsItem(ArrayActions arrayActionsItem) { return this; } - /** + /** * List of permitted actions for all the subarrays of the group * @return arrayActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[read, write]", value = "List of permitted actions for all the subarrays of the group") - public List getArrayActions() { return arrayActions; } - public void setArrayActions(List arrayActions) { this.arrayActions = arrayActions; } public GroupSharingRequest namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace being granted group access can be a user or organization * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "MyOrganization", value = "namespace being granted group access can be a user or organization") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupSharingRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -193,13 +155,12 @@ public boolean equals(Object o) { GroupSharingRequest groupSharingRequest = (GroupSharingRequest) o; return Objects.equals(this.groupActions, groupSharingRequest.groupActions) && Objects.equals(this.arrayActions, groupSharingRequest.arrayActions) && - Objects.equals(this.namespace, groupSharingRequest.namespace)&& - Objects.equals(this.additionalProperties, groupSharingRequest.additionalProperties); + Objects.equals(this.namespace, groupSharingRequest.namespace); } @Override public int hashCode() { - return Objects.hash(groupActions, arrayActions, namespace, additionalProperties); + return Objects.hash(groupActions, arrayActions, namespace); } @Override @@ -209,7 +170,6 @@ public String toString() { sb.append(" groupActions: ").append(toIndentedString(groupActions)).append("\n"); sb.append(" arrayActions: ").append(toIndentedString(arrayActions)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -240,29 +200,36 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupSharingRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupSharingRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupSharingRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupSharingRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupSharingRequest is not found in the empty JSON string", GroupSharingRequest.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupSharingRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupSharingRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonNull() && !jsonObj.get("group_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `group_actions` to be an array in the JSON string but got `%s`", jsonObj.get("group_actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("array_actions") != null && !jsonObj.get("array_actions").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_actions") != null && !jsonObj.get("array_actions").isJsonNull() && !jsonObj.get("array_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_actions` to be an array in the JSON string but got `%s`", jsonObj.get("array_actions").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } } @@ -282,71 +249,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupSharingRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupSharingRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupSharingRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupSharingRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupSharingRequest - * @throws IOException if the JSON string is invalid with respect to GroupSharingRequest - */ + /** + * Create an instance of GroupSharingRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupSharingRequest + * @throws IOException if the JSON string is invalid with respect to GroupSharingRequest + */ public static GroupSharingRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupSharingRequest.class); } - /** - * Convert an instance of GroupSharingRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupSharingRequest 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/model/GroupType.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupType.java index 410ffcc..f7f82d9 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -80,5 +81,10 @@ public GroupType read(final JsonReader jsonReader) throws IOException { return GroupType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GroupType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKey.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKey.java index 6a7c211..cd7494c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKey.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKey.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -66,5 +67,10 @@ public GroupTypeMetadataKey read(final JsonReader jsonReader) throws IOException return GroupTypeMetadataKey.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GroupTypeMetadataKey.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/GroupUpdate.java b/src/main/java/io/tiledb/cloud/rest_api/model/GroupUpdate.java index 178fa82..5d110ad 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/GroupUpdate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/GroupUpdate.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +52,7 @@ /** * Updates for a group. New values for the attributes. */ -@ApiModel(description = "Updates for a group. New values for the attributes.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class GroupUpdate { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) @@ -65,7 +72,7 @@ public class GroupUpdate { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; @SerializedName(SERIALIZED_NAME_LICENSE_ID) @@ -75,103 +82,86 @@ public class GroupUpdate { @SerializedName(SERIALIZED_NAME_LICENSE_TEXT) private String licenseText; - public GroupUpdate() { + public GroupUpdate() { } public GroupUpdate description(String description) { - this.description = description; return this; } - /** + /** * A human readable description of the content of the group * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A human readable description of the content of the group") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public GroupUpdate name(String name) { - this.name = name; return this; } - /** + /** * The name of the group. If must be unique within the group. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group. If must be unique within the group.") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public GroupUpdate logo(String logo) { - this.logo = logo; return this; } - /** + /** * logo (base64 encoded) for the group. Optional * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "logo (base64 encoded) for the group. Optional") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public GroupUpdate accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * the name of the access credentials to use. if unset, the default credentials will be used * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public GroupUpdate tags(List tags) { - this.tags = tags; return this; } @@ -184,103 +174,57 @@ public GroupUpdate addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for groups * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for groups") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public GroupUpdate licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public GroupUpdate licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public GroupUpdate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -298,8 +242,7 @@ public boolean equals(Object o) { Objects.equals(this.accessCredentialsName, groupUpdate.accessCredentialsName) && Objects.equals(this.tags, groupUpdate.tags) && Objects.equals(this.licenseId, groupUpdate.licenseId) && - Objects.equals(this.licenseText, groupUpdate.licenseText)&& - Objects.equals(this.additionalProperties, groupUpdate.additionalProperties); + Objects.equals(this.licenseText, groupUpdate.licenseText); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -308,7 +251,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(description, name, logo, accessCredentialsName, tags, licenseId, licenseText, additionalProperties); + return Objects.hash(description, name, logo, accessCredentialsName, tags, licenseId, licenseText); } private static int hashCodeNullable(JsonNullable a) { @@ -329,7 +272,6 @@ public String toString() { sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -364,40 +306,47 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupUpdate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (GroupUpdate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 GroupUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GroupUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in GroupUpdate is not found in the empty JSON string", GroupUpdate.openapiRequiredFields.toString())); } } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GroupUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupUpdate` 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } } @@ -417,71 +366,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GroupUpdate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public GroupUpdate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - GroupUpdate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of GroupUpdate given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupUpdate - * @throws IOException if the JSON string is invalid with respect to GroupUpdate - */ + /** + * Create an instance of GroupUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupUpdate + * @throws IOException if the JSON string is invalid with respect to GroupUpdate + */ public static GroupUpdate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupUpdate.class); } - /** - * Convert an instance of GroupUpdate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupUpdate 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/model/Invitation.java b/src/main/java/io/tiledb/cloud/rest_api/model/Invitation.java index 967d1e2..d822cc4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Invitation.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Invitation.java @@ -14,27 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.InvitationStatus; +import io.tiledb.cloud.rest_api.model.InvitationType; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +53,7 @@ /** * Invitations to share or collaborate */ -@ApiModel(description = "Invitations to share or collaborate") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Invitation { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -125,503 +135,388 @@ public class Invitation { @SerializedName(SERIALIZED_NAME_NAMESPACE_INVITED) private String namespaceInvited; - public Invitation() { + public Invitation() { } public Invitation id(String id) { - this.id = id; return this; } - /** + /** * Unique ID of invitation added to magic link * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of invitation added to magic link") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public Invitation invitationType(InvitationType invitationType) { - this.invitationType = invitationType; return this; } - /** + /** * Get invitationType * @return invitationType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public InvitationType getInvitationType() { return invitationType; } - public void setInvitationType(InvitationType invitationType) { this.invitationType = invitationType; } public Invitation ownerNamespaceUuid(String ownerNamespaceUuid) { - this.ownerNamespaceUuid = ownerNamespaceUuid; return this; } - /** + /** * Namespace of the owner of the invitation (user or organization) * @return ownerNamespaceUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Namespace of the owner of the invitation (user or organization)") - public String getOwnerNamespaceUuid() { return ownerNamespaceUuid; } - public void setOwnerNamespaceUuid(String ownerNamespaceUuid) { this.ownerNamespaceUuid = ownerNamespaceUuid; } public Invitation inviterUuid(String inviterUuid) { - this.inviterUuid = inviterUuid; return this; } - /** + /** * Unique ID of the user that sent the invitation * @return inviterUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the user that sent the invitation") - public String getInviterUuid() { return inviterUuid; } - public void setInviterUuid(String inviterUuid) { this.inviterUuid = inviterUuid; } public Invitation userNamespaceUuid(String userNamespaceUuid) { - this.userNamespaceUuid = userNamespaceUuid; return this; } - /** + /** * Unique ID of the user accepted the invitation * @return userNamespaceUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the user accepted the invitation") - public String getUserNamespaceUuid() { return userNamespaceUuid; } - public void setUserNamespaceUuid(String userNamespaceUuid) { this.userNamespaceUuid = userNamespaceUuid; } public Invitation organizationUserUuid(String organizationUserUuid) { - this.organizationUserUuid = organizationUserUuid; return this; } - /** + /** * Unique ID of the organization user accepted the invitation * @return organizationUserUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the organization user accepted the invitation") - public String getOrganizationUserUuid() { return organizationUserUuid; } - public void setOrganizationUserUuid(String organizationUserUuid) { this.organizationUserUuid = organizationUserUuid; } public Invitation organizationName(String organizationName) { - this.organizationName = organizationName; return this; } - /** + /** * Name of the organization, does not persist in database * @return organizationName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "organization_name", value = "Name of the organization, does not persist in database") - public String getOrganizationName() { return organizationName; } - public void setOrganizationName(String organizationName) { this.organizationName = organizationName; } public Invitation organizationRole(OrganizationRoles organizationRole) { - this.organizationRole = organizationRole; return this; } - /** + /** * Get organizationRole * @return organizationRole - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public OrganizationRoles getOrganizationRole() { return organizationRole; } - public void setOrganizationRole(OrganizationRoles organizationRole) { this.organizationRole = organizationRole; } public Invitation organizationUuid(String organizationUuid) { - this.organizationUuid = organizationUuid; return this; } - /** + /** * Unique ID of the organization whose user(s) accepted the invitation * @return organizationUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the organization whose user(s) accepted the invitation") - public String getOrganizationUuid() { return organizationUuid; } - public void setOrganizationUuid(String organizationUuid) { this.organizationUuid = organizationUuid; } public Invitation arrayUuid(String arrayUuid) { - this.arrayUuid = arrayUuid; return this; } - /** + /** * Unique ID of the array * @return arrayUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the array") - public String getArrayUuid() { return arrayUuid; } - public void setArrayUuid(String arrayUuid) { this.arrayUuid = arrayUuid; } public Invitation groupUuid(String groupUuid) { - this.groupUuid = groupUuid; return this; } - /** + /** * Unique ID of the group * @return groupUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the group") - public String getGroupUuid() { return groupUuid; } - public void setGroupUuid(String groupUuid) { this.groupUuid = groupUuid; } public Invitation arrayName(String arrayName) { - this.arrayName = arrayName; return this; } - /** + /** * Name of the array, does not persist in database * @return arrayName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "array_name", value = "Name of the array, does not persist in database") - public String getArrayName() { return arrayName; } - public void setArrayName(String arrayName) { this.arrayName = arrayName; } public Invitation email(String email) { - this.email = email; return this; } - /** + /** * Email of the individual we send the invitation to * @return email - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "jane@doe.com", value = "Email of the individual we send the invitation to") - public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } public Invitation actions(String actions) { - this.actions = actions; return this; } - /** + /** * A comma separated list of ArrayActions or NamespaceActions * @return actions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "read,write", value = "A comma separated list of ArrayActions or NamespaceActions") - public String getActions() { return actions; } - public void setActions(String actions) { this.actions = actions; } public Invitation groupActions(String groupActions) { - this.groupActions = groupActions; return this; } - /** + /** * A comma separated list of GroupActions * @return groupActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "read,write", value = "A comma separated list of GroupActions") - public String getGroupActions() { return groupActions; } - public void setGroupActions(String groupActions) { this.groupActions = groupActions; } public Invitation status(InvitationStatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public InvitationStatus getStatus() { return status; } - public void setStatus(InvitationStatus status) { this.status = status; } public Invitation createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } - /** + /** * Datetime the invitation was created in UTC * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime the invitation was created in UTC") - public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } public Invitation expiresAt(OffsetDateTime expiresAt) { - this.expiresAt = expiresAt; return this; } - /** + /** * Datetime the invitation is expected to expire in UTC * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime the invitation is expected to expire in UTC") - public OffsetDateTime getExpiresAt() { return expiresAt; } - public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; } public Invitation acceptedAt(OffsetDateTime acceptedAt) { - this.acceptedAt = acceptedAt; return this; } - /** + /** * Datetime the invitation was accepted in UTC * @return acceptedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime the invitation was accepted in UTC") - public OffsetDateTime getAcceptedAt() { return acceptedAt; } - public void setAcceptedAt(OffsetDateTime acceptedAt) { this.acceptedAt = acceptedAt; } public Invitation namespaceInvited(String namespaceInvited) { - this.namespaceInvited = namespaceInvited; return this; } - /** + /** * The namespace invited (user or organization, if it exists in the DB) * @return namespaceInvited - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The namespace invited (user or organization, if it exists in the DB)") - public String getNamespaceInvited() { return namespaceInvited; } - public void setNamespaceInvited(String namespaceInvited) { this.namespaceInvited = namespaceInvited; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Invitation putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -652,13 +547,12 @@ public boolean equals(Object o) { Objects.equals(this.createdAt, invitation.createdAt) && Objects.equals(this.expiresAt, invitation.expiresAt) && Objects.equals(this.acceptedAt, invitation.acceptedAt) && - Objects.equals(this.namespaceInvited, invitation.namespaceInvited)&& - Objects.equals(this.additionalProperties, invitation.additionalProperties); + Objects.equals(this.namespaceInvited, invitation.namespaceInvited); } @Override public int hashCode() { - return Objects.hash(id, invitationType, ownerNamespaceUuid, inviterUuid, userNamespaceUuid, organizationUserUuid, organizationName, organizationRole, organizationUuid, arrayUuid, groupUuid, arrayName, email, actions, groupActions, status, createdAt, expiresAt, acceptedAt, namespaceInvited, additionalProperties); + return Objects.hash(id, invitationType, ownerNamespaceUuid, inviterUuid, userNamespaceUuid, organizationUserUuid, organizationName, organizationRole, organizationUuid, arrayUuid, groupUuid, arrayName, email, actions, groupActions, status, createdAt, expiresAt, acceptedAt, namespaceInvited); } @Override @@ -685,7 +579,6 @@ public String toString() { sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append(" acceptedAt: ").append(toIndentedString(acceptedAt)).append("\n"); sb.append(" namespaceInvited: ").append(toIndentedString(namespaceInvited)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -733,60 +626,79 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Invitation - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Invitation.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + 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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("owner_namespace_uuid") != null && !jsonObj.get("owner_namespace_uuid").isJsonPrimitive()) { + // validate the optional field `invitation_type` + if (jsonObj.get("invitation_type") != null && !jsonObj.get("invitation_type").isJsonNull()) { + InvitationType.validateJsonElement(jsonObj.get("invitation_type")); + } + if ((jsonObj.get("owner_namespace_uuid") != null && !jsonObj.get("owner_namespace_uuid").isJsonNull()) && !jsonObj.get("owner_namespace_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `owner_namespace_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_namespace_uuid").toString())); } - if (jsonObj.get("inviter_uuid") != null && !jsonObj.get("inviter_uuid").isJsonPrimitive()) { + if ((jsonObj.get("inviter_uuid") != null && !jsonObj.get("inviter_uuid").isJsonNull()) && !jsonObj.get("inviter_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `inviter_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inviter_uuid").toString())); } - if (jsonObj.get("user_namespace_uuid") != null && !jsonObj.get("user_namespace_uuid").isJsonPrimitive()) { + if ((jsonObj.get("user_namespace_uuid") != null && !jsonObj.get("user_namespace_uuid").isJsonNull()) && !jsonObj.get("user_namespace_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `user_namespace_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_namespace_uuid").toString())); } - if (jsonObj.get("organization_user_uuid") != null && !jsonObj.get("organization_user_uuid").isJsonPrimitive()) { + if ((jsonObj.get("organization_user_uuid") != null && !jsonObj.get("organization_user_uuid").isJsonNull()) && !jsonObj.get("organization_user_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `organization_user_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_user_uuid").toString())); } - if (jsonObj.get("organization_name") != null && !jsonObj.get("organization_name").isJsonPrimitive()) { + if ((jsonObj.get("organization_name") != null && !jsonObj.get("organization_name").isJsonNull()) && !jsonObj.get("organization_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `organization_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_name").toString())); } - if (jsonObj.get("organization_uuid") != null && !jsonObj.get("organization_uuid").isJsonPrimitive()) { + // validate the optional field `organization_role` + if (jsonObj.get("organization_role") != null && !jsonObj.get("organization_role").isJsonNull()) { + OrganizationRoles.validateJsonElement(jsonObj.get("organization_role")); + } + if ((jsonObj.get("organization_uuid") != null && !jsonObj.get("organization_uuid").isJsonNull()) && !jsonObj.get("organization_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `organization_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_uuid").toString())); } - if (jsonObj.get("array_uuid") != null && !jsonObj.get("array_uuid").isJsonPrimitive()) { + if ((jsonObj.get("array_uuid") != null && !jsonObj.get("array_uuid").isJsonNull()) && !jsonObj.get("array_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_uuid").toString())); } - if (jsonObj.get("group_uuid") != null && !jsonObj.get("group_uuid").isJsonPrimitive()) { + if ((jsonObj.get("group_uuid") != null && !jsonObj.get("group_uuid").isJsonNull()) && !jsonObj.get("group_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `group_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("group_uuid").toString())); } - if (jsonObj.get("array_name") != null && !jsonObj.get("array_name").isJsonPrimitive()) { + if ((jsonObj.get("array_name") != null && !jsonObj.get("array_name").isJsonNull()) && !jsonObj.get("array_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_name").toString())); } - if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { + 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("actions") != null && !jsonObj.get("actions").isJsonPrimitive()) { + if ((jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonNull()) && !jsonObj.get("actions").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `actions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actions").toString())); } - if (jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonPrimitive()) { + if ((jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonNull()) && !jsonObj.get("group_actions").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `group_actions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("group_actions").toString())); } - if (jsonObj.get("namespace_invited") != null && !jsonObj.get("namespace_invited").isJsonPrimitive()) { + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + InvitationStatus.validateJsonElement(jsonObj.get("status")); + } + if ((jsonObj.get("namespace_invited") != null && !jsonObj.get("namespace_invited").isJsonNull()) && !jsonObj.get("namespace_invited").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_invited` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_invited").toString())); } } @@ -806,71 +718,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Invitation value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Invitation read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Invitation instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/InvitationArrayShareEmail.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmail.java index ad001a6..1b61279 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmail.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmail.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +52,7 @@ /** * Encapsulates information regarding inviting people using email to share array, same permissions for all invitees */ -@ApiModel(description = "Encapsulates information regarding inviting people using email to share array, same permissions for all invitees") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InvitationArrayShareEmail { public static final String SERIALIZED_NAME_ACTIONS = "actions"; @SerializedName(SERIALIZED_NAME_ACTIONS) @@ -54,99 +62,62 @@ public class InvitationArrayShareEmail { @SerializedName(SERIALIZED_NAME_INVITEE_EMAIL) private List inviteeEmail = new ArrayList<>(); - public InvitationArrayShareEmail() { + public InvitationArrayShareEmail() { } public InvitationArrayShareEmail actions(List actions) { - this.actions = actions; return this; } public InvitationArrayShareEmail addActionsItem(ArrayActions actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } this.actions.add(actionsItem); return this; } - /** + /** * List of permitted actions * @return actions - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "[read, write]", required = true, value = "List of permitted actions") - public List getActions() { return actions; } - public void setActions(List actions) { this.actions = actions; } public InvitationArrayShareEmail inviteeEmail(List inviteeEmail) { - this.inviteeEmail = inviteeEmail; return this; } public InvitationArrayShareEmail addInviteeEmailItem(String inviteeEmailItem) { + if (this.inviteeEmail == null) { + this.inviteeEmail = new ArrayList<>(); + } this.inviteeEmail.add(inviteeEmailItem); return this; } - /** + /** * Get inviteeEmail * @return inviteeEmail - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public List getInviteeEmail() { return inviteeEmail; } - public void setInviteeEmail(List inviteeEmail) { this.inviteeEmail = inviteeEmail; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public InvitationArrayShareEmail putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -159,13 +130,12 @@ public boolean equals(Object o) { } InvitationArrayShareEmail invitationArrayShareEmail = (InvitationArrayShareEmail) o; return Objects.equals(this.actions, invitationArrayShareEmail.actions) && - Objects.equals(this.inviteeEmail, invitationArrayShareEmail.inviteeEmail)&& - Objects.equals(this.additionalProperties, invitationArrayShareEmail.additionalProperties); + Objects.equals(this.inviteeEmail, invitationArrayShareEmail.inviteeEmail); } @Override public int hashCode() { - return Objects.hash(actions, inviteeEmail, additionalProperties); + return Objects.hash(actions, inviteeEmail); } @Override @@ -174,7 +144,6 @@ public String toString() { sb.append("class InvitationArrayShareEmail {\n"); sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append(" inviteeEmail: ").append(toIndentedString(inviteeEmail)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -206,33 +175,44 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("invitee_email"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitationArrayShareEmail - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InvitationArrayShareEmail.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 InvitationArrayShareEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationArrayShareEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationArrayShareEmail is not found in the empty JSON string", InvitationArrayShareEmail.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationArrayShareEmail.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationArrayShareEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InvitationArrayShareEmail.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - // ensure the json data is an array - if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonArray()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("actions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("invitee_email") != null && !jsonObj.get("invitee_email").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("invitee_email") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("invitee_email").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `invitee_email` to be an array in the JSON string but got `%s`", jsonObj.get("invitee_email").toString())); } } @@ -252,71 +232,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, InvitationArrayShareEmail value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public InvitationArrayShareEmail read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - InvitationArrayShareEmail instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of InvitationArrayShareEmail given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitationArrayShareEmail - * @throws IOException if the JSON string is invalid with respect to InvitationArrayShareEmail - */ + /** + * Create an instance of InvitationArrayShareEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationArrayShareEmail + * @throws IOException if the JSON string is invalid with respect to InvitationArrayShareEmail + */ public static InvitationArrayShareEmail fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InvitationArrayShareEmail.class); } - /** - * Convert an instance of InvitationArrayShareEmail to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InvitationArrayShareEmail 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/model/InvitationData.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationData.java index 11db85c..a3efe62 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationData.java @@ -14,51 +14,59 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Invitation; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Object including invitations and metadata */ -@ApiModel(description = "Object including invitations and metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InvitationData { public static final String SERIALIZED_NAME_INVITATIONS = "invitations"; @SerializedName(SERIALIZED_NAME_INVITATIONS) - private List invitations = null; + private List invitations = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public InvitationData() { + public InvitationData() { } public InvitationData invitations(List invitations) { - this.invitations = invitations; return this; } @@ -71,80 +79,38 @@ public InvitationData addInvitationsItem(Invitation invitationsItem) { return this; } - /** + /** * List of invitations * @return invitations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of invitations") - public List getInvitations() { return invitations; } - public void setInvitations(List invitations) { this.invitations = invitations; } public InvitationData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public InvitationData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +123,12 @@ public boolean equals(Object o) { } InvitationData invitationData = (InvitationData) o; return Objects.equals(this.invitations, invitationData.invitations) && - Objects.equals(this.paginationMetadata, invitationData.paginationMetadata)&& - Objects.equals(this.additionalProperties, invitationData.additionalProperties); + Objects.equals(this.paginationMetadata, invitationData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(invitations, paginationMetadata, additionalProperties); + return Objects.hash(invitations, paginationMetadata); } @Override @@ -172,7 +137,6 @@ public String toString() { sb.append("class InvitationData {\n"); sb.append(" invitations: ").append(toIndentedString(invitations)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitationData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InvitationData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 InvitationData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationData is not found in the empty JSON string", InvitationData.openapiRequiredFields.toString())); } } - JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); - if (jsonArrayinvitations != null) { - // ensure the json data is an array - if (!jsonObj.get("invitations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); - } - // validate the optional field `invitations` (array) - for (int i = 0; i < jsonArrayinvitations.size(); i++) { - Invitation.validateJsonObject(jsonArrayinvitations.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("invitations") != null && !jsonObj.get("invitations").isJsonNull()) { + JsonArray jsonArrayinvitations = jsonObj.getAsJsonArray("invitations"); + if (jsonArrayinvitations != null) { + // ensure the json data is an array + if (!jsonObj.get("invitations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `invitations` to be an array in the JSON string but got `%s`", jsonObj.get("invitations").toString())); + } + + // validate the optional field `invitations` (array) + for (int i = 0; i < jsonArrayinvitations.size(); i++) { + Invitation.validateJsonElement(jsonArrayinvitations.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -249,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, InvitationData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public InvitationData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - InvitationData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of InvitationData given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitationData - * @throws IOException if the JSON string is invalid with respect to InvitationData - */ + /** + * Create an instance of InvitationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationData + * @throws IOException if the JSON string is invalid with respect to InvitationData + */ public static InvitationData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InvitationData.class); } - /** - * Convert an instance of InvitationData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InvitationData 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/model/InvitationFailedRecipients.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipients.java index 380bb14..c070e51 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipients.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipients.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,78 +51,41 @@ /** * Encapsulates information regarding the failed invitation recipients */ -@ApiModel(description = "Encapsulates information regarding the failed invitation recipients") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InvitationFailedRecipients { public static final String SERIALIZED_NAME_FAILED_RECIPIENTS = "failed_recipients"; @SerializedName(SERIALIZED_NAME_FAILED_RECIPIENTS) private List failedRecipients = new ArrayList<>(); - public InvitationFailedRecipients() { + public InvitationFailedRecipients() { } public InvitationFailedRecipients failedRecipients(List failedRecipients) { - this.failedRecipients = failedRecipients; return this; } public InvitationFailedRecipients addFailedRecipientsItem(String failedRecipientsItem) { + if (this.failedRecipients == null) { + this.failedRecipients = new ArrayList<>(); + } this.failedRecipients.add(failedRecipientsItem); return this; } - /** + /** * Get failedRecipients * @return failedRecipients - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public List getFailedRecipients() { return failedRecipients; } - public void setFailedRecipients(List failedRecipients) { this.failedRecipients = failedRecipients; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public InvitationFailedRecipients putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -126,13 +97,12 @@ public boolean equals(Object o) { return false; } InvitationFailedRecipients invitationFailedRecipients = (InvitationFailedRecipients) o; - return Objects.equals(this.failedRecipients, invitationFailedRecipients.failedRecipients)&& - Objects.equals(this.additionalProperties, invitationFailedRecipients.additionalProperties); + return Objects.equals(this.failedRecipients, invitationFailedRecipients.failedRecipients); } @Override public int hashCode() { - return Objects.hash(failedRecipients, additionalProperties); + return Objects.hash(failedRecipients); } @Override @@ -140,7 +110,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class InvitationFailedRecipients {\n"); sb.append(" failedRecipients: ").append(toIndentedString(failedRecipients)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -170,29 +139,38 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("failed_recipients"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitationFailedRecipients - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InvitationFailedRecipients.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 InvitationFailedRecipients + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationFailedRecipients.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationFailedRecipients is not found in the empty JSON string", InvitationFailedRecipients.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationFailedRecipients.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationFailedRecipients` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InvitationFailedRecipients.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - // ensure the json data is an array - if (jsonObj.get("failed_recipients") != null && !jsonObj.get("failed_recipients").isJsonArray()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("failed_recipients") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("failed_recipients").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `failed_recipients` to be an array in the JSON string but got `%s`", jsonObj.get("failed_recipients").toString())); } } @@ -212,71 +190,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, InvitationFailedRecipients value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public InvitationFailedRecipients read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - InvitationFailedRecipients instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of InvitationFailedRecipients given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitationFailedRecipients - * @throws IOException if the JSON string is invalid with respect to InvitationFailedRecipients - */ + /** + * Create an instance of InvitationFailedRecipients given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationFailedRecipients + * @throws IOException if the JSON string is invalid with respect to InvitationFailedRecipients + */ public static InvitationFailedRecipients fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InvitationFailedRecipients.class); } - /** - * Convert an instance of InvitationFailedRecipients to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InvitationFailedRecipients 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/model/InvitationGroupShareEmail.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmail.java index 2c10881..20c1d4a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmail.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmail.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.GroupActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +53,7 @@ /** * Encapsulates information regarding inviting people using email to share group, same permissions for all invitees */ -@ApiModel(description = "Encapsulates information regarding inviting people using email to share group, same permissions for all invitees") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InvitationGroupShareEmail { public static final String SERIALIZED_NAME_ARRAY_ACTIONS = "array_actions"; @SerializedName(SERIALIZED_NAME_ARRAY_ACTIONS) @@ -58,127 +67,89 @@ public class InvitationGroupShareEmail { @SerializedName(SERIALIZED_NAME_INVITEE_EMAIL_OR_NAME) private List inviteeEmailOrName = new ArrayList<>(); - public InvitationGroupShareEmail() { + public InvitationGroupShareEmail() { } public InvitationGroupShareEmail arrayActions(List arrayActions) { - this.arrayActions = arrayActions; return this; } public InvitationGroupShareEmail addArrayActionsItem(ArrayActions arrayActionsItem) { + if (this.arrayActions == null) { + this.arrayActions = new ArrayList<>(); + } this.arrayActions.add(arrayActionsItem); return this; } - /** + /** * List of permitted array actions * @return arrayActions - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "[read, write]", required = true, value = "List of permitted array actions") - public List getArrayActions() { return arrayActions; } - public void setArrayActions(List arrayActions) { this.arrayActions = arrayActions; } public InvitationGroupShareEmail groupActions(List groupActions) { - this.groupActions = groupActions; return this; } public InvitationGroupShareEmail addGroupActionsItem(GroupActions groupActionsItem) { + if (this.groupActions == null) { + this.groupActions = new ArrayList<>(); + } this.groupActions.add(groupActionsItem); return this; } - /** + /** * List of permitted group actions * @return groupActions - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "[read, write]", required = true, value = "List of permitted group actions") - public List getGroupActions() { return groupActions; } - public void setGroupActions(List groupActions) { this.groupActions = groupActions; } public InvitationGroupShareEmail inviteeEmailOrName(List inviteeEmailOrName) { - this.inviteeEmailOrName = inviteeEmailOrName; return this; } public InvitationGroupShareEmail addInviteeEmailOrNameItem(String inviteeEmailOrNameItem) { + if (this.inviteeEmailOrName == null) { + this.inviteeEmailOrName = new ArrayList<>(); + } this.inviteeEmailOrName.add(inviteeEmailOrNameItem); return this; } - /** + /** * Get inviteeEmailOrName * @return inviteeEmailOrName - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public List getInviteeEmailOrName() { return inviteeEmailOrName; } - public void setInviteeEmailOrName(List inviteeEmailOrName) { this.inviteeEmailOrName = inviteeEmailOrName; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public InvitationGroupShareEmail putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -192,13 +163,12 @@ public boolean equals(Object o) { InvitationGroupShareEmail invitationGroupShareEmail = (InvitationGroupShareEmail) o; return Objects.equals(this.arrayActions, invitationGroupShareEmail.arrayActions) && Objects.equals(this.groupActions, invitationGroupShareEmail.groupActions) && - Objects.equals(this.inviteeEmailOrName, invitationGroupShareEmail.inviteeEmailOrName)&& - Objects.equals(this.additionalProperties, invitationGroupShareEmail.additionalProperties); + Objects.equals(this.inviteeEmailOrName, invitationGroupShareEmail.inviteeEmailOrName); } @Override public int hashCode() { - return Objects.hash(arrayActions, groupActions, inviteeEmailOrName, additionalProperties); + return Objects.hash(arrayActions, groupActions, inviteeEmailOrName); } @Override @@ -208,7 +178,6 @@ public String toString() { sb.append(" arrayActions: ").append(toIndentedString(arrayActions)).append("\n"); sb.append(" groupActions: ").append(toIndentedString(groupActions)).append("\n"); sb.append(" inviteeEmailOrName: ").append(toIndentedString(inviteeEmailOrName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -242,37 +211,50 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("invitee_email_or_name"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitationGroupShareEmail - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InvitationGroupShareEmail.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 InvitationGroupShareEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationGroupShareEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationGroupShareEmail is not found in the empty JSON string", InvitationGroupShareEmail.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationGroupShareEmail.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationGroupShareEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InvitationGroupShareEmail.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - // ensure the json data is an array - if (jsonObj.get("array_actions") != null && !jsonObj.get("array_actions").isJsonArray()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("array_actions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("array_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_actions` to be an array in the JSON string but got `%s`", jsonObj.get("array_actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("group_actions") != null && !jsonObj.get("group_actions").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("group_actions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("group_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `group_actions` to be an array in the JSON string but got `%s`", jsonObj.get("group_actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("invitee_email_or_name") != null && !jsonObj.get("invitee_email_or_name").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("invitee_email_or_name") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("invitee_email_or_name").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `invitee_email_or_name` to be an array in the JSON string but got `%s`", jsonObj.get("invitee_email_or_name").toString())); } } @@ -292,71 +274,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, InvitationGroupShareEmail value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public InvitationGroupShareEmail read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - InvitationGroupShareEmail instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of InvitationGroupShareEmail given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitationGroupShareEmail - * @throws IOException if the JSON string is invalid with respect to InvitationGroupShareEmail - */ + /** + * Create an instance of InvitationGroupShareEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationGroupShareEmail + * @throws IOException if the JSON string is invalid with respect to InvitationGroupShareEmail + */ public static InvitationGroupShareEmail fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InvitationGroupShareEmail.class); } - /** - * Convert an instance of InvitationGroupShareEmail to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InvitationGroupShareEmail 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/model/InvitationOrganizationJoinEmail.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmail.java index 5ac2ae4..9d28069 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmail.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmail.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,12 +53,11 @@ /** * Encapsulates information regarding inviting people using email to join organization, same permissions for all invitees */ -@ApiModel(description = "Encapsulates information regarding inviting people using email to join organization, same permissions for all invitees") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InvitationOrganizationJoinEmail { public static final String SERIALIZED_NAME_ACTIONS = "actions"; @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = null; + private List actions = new ArrayList<>(); public static final String SERIALIZED_NAME_ORGANIZATION_ROLE = "organization_role"; @SerializedName(SERIALIZED_NAME_ORGANIZATION_ROLE) @@ -58,11 +67,10 @@ public class InvitationOrganizationJoinEmail { @SerializedName(SERIALIZED_NAME_INVITEE_EMAIL) private List inviteeEmail = new ArrayList<>(); - public InvitationOrganizationJoinEmail() { + public InvitationOrganizationJoinEmail() { } public InvitationOrganizationJoinEmail actions(List actions) { - this.actions = actions; return this; } @@ -75,108 +83,65 @@ public InvitationOrganizationJoinEmail addActionsItem(NamespaceActions actionsIt return this; } - /** + /** * List of permitted actions * @return actions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[read, write]", value = "List of permitted actions") - public List getActions() { return actions; } - public void setActions(List actions) { this.actions = actions; } public InvitationOrganizationJoinEmail organizationRole(OrganizationRoles organizationRole) { - this.organizationRole = organizationRole; return this; } - /** + /** * Get organizationRole * @return organizationRole - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public OrganizationRoles getOrganizationRole() { return organizationRole; } - public void setOrganizationRole(OrganizationRoles organizationRole) { this.organizationRole = organizationRole; } public InvitationOrganizationJoinEmail inviteeEmail(List inviteeEmail) { - this.inviteeEmail = inviteeEmail; return this; } public InvitationOrganizationJoinEmail addInviteeEmailItem(String inviteeEmailItem) { + if (this.inviteeEmail == null) { + this.inviteeEmail = new ArrayList<>(); + } this.inviteeEmail.add(inviteeEmailItem); return this; } - /** + /** * Get inviteeEmail * @return inviteeEmail - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public List getInviteeEmail() { return inviteeEmail; } - public void setInviteeEmail(List inviteeEmail) { this.inviteeEmail = inviteeEmail; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public InvitationOrganizationJoinEmail putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -190,13 +155,12 @@ public boolean equals(Object o) { InvitationOrganizationJoinEmail invitationOrganizationJoinEmail = (InvitationOrganizationJoinEmail) o; return Objects.equals(this.actions, invitationOrganizationJoinEmail.actions) && Objects.equals(this.organizationRole, invitationOrganizationJoinEmail.organizationRole) && - Objects.equals(this.inviteeEmail, invitationOrganizationJoinEmail.inviteeEmail)&& - Objects.equals(this.additionalProperties, invitationOrganizationJoinEmail.additionalProperties); + Objects.equals(this.inviteeEmail, invitationOrganizationJoinEmail.inviteeEmail); } @Override public int hashCode() { - return Objects.hash(actions, organizationRole, inviteeEmail, additionalProperties); + return Objects.hash(actions, organizationRole, inviteeEmail); } @Override @@ -206,7 +170,6 @@ public String toString() { sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append(" organizationRole: ").append(toIndentedString(organizationRole)).append("\n"); sb.append(" inviteeEmail: ").append(toIndentedString(inviteeEmail)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -239,33 +202,44 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("invitee_email"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitationOrganizationJoinEmail - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InvitationOrganizationJoinEmail.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 InvitationOrganizationJoinEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationOrganizationJoinEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationOrganizationJoinEmail is not found in the empty JSON string", InvitationOrganizationJoinEmail.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!InvitationOrganizationJoinEmail.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitationOrganizationJoinEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InvitationOrganizationJoinEmail.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - // ensure the json data is an array - if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonArray()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonNull() && !jsonObj.get("actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("invitee_email") != null && !jsonObj.get("invitee_email").isJsonArray()) { + // validate the required field `organization_role` + OrganizationRoles.validateJsonElement(jsonObj.get("organization_role")); + // ensure the required json array is present + if (jsonObj.get("invitee_email") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("invitee_email").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `invitee_email` to be an array in the JSON string but got `%s`", jsonObj.get("invitee_email").toString())); } } @@ -285,71 +259,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, InvitationOrganizationJoinEmail value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public InvitationOrganizationJoinEmail read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - InvitationOrganizationJoinEmail instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of InvitationOrganizationJoinEmail given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitationOrganizationJoinEmail - * @throws IOException if the JSON string is invalid with respect to InvitationOrganizationJoinEmail - */ + /** + * Create an instance of InvitationOrganizationJoinEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationOrganizationJoinEmail + * @throws IOException if the JSON string is invalid with respect to InvitationOrganizationJoinEmail + */ public static InvitationOrganizationJoinEmail fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InvitationOrganizationJoinEmail.class); } - /** - * Convert an instance of InvitationOrganizationJoinEmail to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InvitationOrganizationJoinEmail 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/model/InvitationStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationStatus.java index 5b5e98f..45bff2f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationStatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public InvitationStatus read(final JsonReader jsonReader) throws IOException { return InvitationStatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + InvitationStatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationType.java b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationType.java index c6c2072..697523d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/InvitationType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/InvitationType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -72,5 +73,10 @@ public InvitationType read(final JsonReader jsonReader) throws IOException { return InvitationType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + InvitationType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/LastAccessedArray.java b/src/main/java/io/tiledb/cloud/rest_api/model/LastAccessedArray.java index 5843e91..cfbd879 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/LastAccessedArray.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/LastAccessedArray.java @@ -14,27 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ActivityEventType; import java.io.IOException; import java.math.BigDecimal; +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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +51,7 @@ /** * Information related to last access of an array */ -@ApiModel(description = "Information related to last access of an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class LastAccessedArray { public static final String SERIALIZED_NAME_ARRAY_ID = "array_id"; @SerializedName(SERIALIZED_NAME_ARRAY_ID) @@ -65,158 +73,103 @@ public class LastAccessedArray { @SerializedName(SERIALIZED_NAME_ACCESS_TYPE) private ActivityEventType accessType; - public LastAccessedArray() { + public LastAccessedArray() { } public LastAccessedArray arrayId(String arrayId) { - this.arrayId = arrayId; return this; } - /** + /** * unique ID of array * @return arrayId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of array") - public String getArrayId() { return arrayId; } - public void setArrayId(String arrayId) { this.arrayId = arrayId; } public LastAccessedArray arrayName(String arrayName) { - this.arrayName = arrayName; return this; } - /** + /** * name of the array * @return arrayName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "array1", value = "name of the array") - public String getArrayName() { return arrayName; } - public void setArrayName(String arrayName) { this.arrayName = arrayName; } public LastAccessedArray namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace of a user or organization * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "mockuser", value = "namespace of a user or organization") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public LastAccessedArray accessedTime(BigDecimal accessedTime) { - this.accessedTime = accessedTime; return this; } - /** + /** * timestamp (epoch milliseconds) array is last accessed * @return accessedTime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1540471791873", value = "timestamp (epoch milliseconds) array is last accessed") - public BigDecimal getAccessedTime() { return accessedTime; } - public void setAccessedTime(BigDecimal accessedTime) { this.accessedTime = accessedTime; } public LastAccessedArray accessType(ActivityEventType accessType) { - this.accessType = accessType; return this; } - /** + /** * Get accessType * @return accessType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ActivityEventType getAccessType() { return accessType; } - public void setAccessType(ActivityEventType accessType) { this.accessType = accessType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public LastAccessedArray putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -232,13 +185,12 @@ public boolean equals(Object o) { Objects.equals(this.arrayName, lastAccessedArray.arrayName) && Objects.equals(this.namespace, lastAccessedArray.namespace) && Objects.equals(this.accessedTime, lastAccessedArray.accessedTime) && - Objects.equals(this.accessType, lastAccessedArray.accessType)&& - Objects.equals(this.additionalProperties, lastAccessedArray.additionalProperties); + Objects.equals(this.accessType, lastAccessedArray.accessType); } @Override public int hashCode() { - return Objects.hash(arrayId, arrayName, namespace, accessedTime, accessType, additionalProperties); + return Objects.hash(arrayId, arrayName, namespace, accessedTime, accessType); } @Override @@ -250,7 +202,6 @@ public String toString() { sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" accessedTime: ").append(toIndentedString(accessedTime)).append("\n"); sb.append(" accessType: ").append(toIndentedString(accessType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -283,29 +234,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to LastAccessedArray - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (LastAccessedArray.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 LastAccessedArray + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LastAccessedArray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in LastAccessedArray is not found in the empty JSON string", LastAccessedArray.openapiRequiredFields.toString())); } } - if (jsonObj.get("array_id") != null && !jsonObj.get("array_id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LastAccessedArray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LastAccessedArray` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("array_id") != null && !jsonObj.get("array_id").isJsonNull()) && !jsonObj.get("array_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_id").toString())); } - if (jsonObj.get("array_name") != null && !jsonObj.get("array_name").isJsonPrimitive()) { + if ((jsonObj.get("array_name") != null && !jsonObj.get("array_name").isJsonNull()) && !jsonObj.get("array_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_name").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } + // validate the optional field `access_type` + if (jsonObj.get("access_type") != null && !jsonObj.get("access_type").isJsonNull()) { + ActivityEventType.validateJsonElement(jsonObj.get("access_type")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -323,71 +285,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, LastAccessedArray value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public LastAccessedArray read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - LastAccessedArray instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of LastAccessedArray given an JSON string - * - * @param jsonString JSON string - * @return An instance of LastAccessedArray - * @throws IOException if the JSON string is invalid with respect to LastAccessedArray - */ + /** + * Create an instance of LastAccessedArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of LastAccessedArray + * @throws IOException if the JSON string is invalid with respect to LastAccessedArray + */ public static LastAccessedArray fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LastAccessedArray.class); } - /** - * Convert an instance of LastAccessedArray to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LastAccessedArray 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/model/Layout.java b/src/main/java/io/tiledb/cloud/rest_api/model/Layout.java index c19915c..9faea4f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Layout.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Layout.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -72,5 +73,10 @@ public Layout read(final JsonReader jsonReader) throws IOException { return Layout.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Layout.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequest.java index 65e0882..bcc0850 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequest.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TileDBConfig; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,73 +50,33 @@ /** * Request to load an array schema */ -@ApiModel(description = "Request to load an array schema") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class LoadArraySchemaRequest { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) private TileDBConfig config; - public LoadArraySchemaRequest() { + public LoadArraySchemaRequest() { } public LoadArraySchemaRequest config(TileDBConfig config) { - this.config = config; return this; } - /** + /** * Get config * @return config - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TileDBConfig getConfig() { return config; } - public void setConfig(TileDBConfig config) { this.config = config; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public LoadArraySchemaRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -119,13 +88,12 @@ public boolean equals(Object o) { return false; } LoadArraySchemaRequest loadArraySchemaRequest = (LoadArraySchemaRequest) o; - return Objects.equals(this.config, loadArraySchemaRequest.config)&& - Objects.equals(this.additionalProperties, loadArraySchemaRequest.additionalProperties); + return Objects.equals(this.config, loadArraySchemaRequest.config); } @Override public int hashCode() { - return Objects.hash(config, additionalProperties); + return Objects.hash(config); } @Override @@ -133,7 +101,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LoadArraySchemaRequest {\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -162,23 +129,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to LoadArraySchemaRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (LoadArraySchemaRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 LoadArraySchemaRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoadArraySchemaRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in LoadArraySchemaRequest is not found in the empty JSON string", LoadArraySchemaRequest.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LoadArraySchemaRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LoadArraySchemaRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `config` - if (jsonObj.getAsJsonObject("config") != null) { - TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + TileDBConfig.validateJsonElement(jsonObj.get("config")); } } @@ -197,71 +171,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, LoadArraySchemaRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public LoadArraySchemaRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - LoadArraySchemaRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of LoadArraySchemaRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of LoadArraySchemaRequest - * @throws IOException if the JSON string is invalid with respect to LoadArraySchemaRequest - */ + /** + * Create an instance of LoadArraySchemaRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoadArraySchemaRequest + * @throws IOException if the JSON string is invalid with respect to LoadArraySchemaRequest + */ public static LoadArraySchemaRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LoadArraySchemaRequest.class); } - /** - * Convert an instance of LoadArraySchemaRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LoadArraySchemaRequest 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/model/LoadArraySchemaResponse.java b/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponse.java index afb0fd9..e38c36f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponse.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponse.java @@ -14,35 +14,45 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArraySchema; import java.io.IOException; +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.lang.reflect.Type; +import java.util.HashMap; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.List; +import java.util.Map; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Contains the latest schema and all schemas for the opened array */ -@ApiModel(description = "Contains the latest schema and all schemas for the opened array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class LoadArraySchemaResponse { public static final String SERIALIZED_NAME_LATEST_ARRAY_SCHEMA = "latest_array_schema"; @SerializedName(SERIALIZED_NAME_LATEST_ARRAY_SCHEMA) @@ -50,36 +60,31 @@ public class LoadArraySchemaResponse { public static final String SERIALIZED_NAME_ALL_ARRAY_SCHEMAS = "all_array_schemas"; @SerializedName(SERIALIZED_NAME_ALL_ARRAY_SCHEMAS) - private Map allArraySchemas = null; + private Map allArraySchemas = new HashMap<>(); - public LoadArraySchemaResponse() { + public LoadArraySchemaResponse() { } public LoadArraySchemaResponse latestArraySchema(ArraySchema latestArraySchema) { - this.latestArraySchema = latestArraySchema; return this; } - /** + /** * Get latestArraySchema * @return latestArraySchema - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArraySchema getLatestArraySchema() { return latestArraySchema; } - public void setLatestArraySchema(ArraySchema latestArraySchema) { this.latestArraySchema = latestArraySchema; } public LoadArraySchemaResponse allArraySchemas(Map allArraySchemas) { - this.allArraySchemas = allArraySchemas; return this; } @@ -92,57 +97,19 @@ public LoadArraySchemaResponse putAllArraySchemasItem(String key, ArraySchema al return this; } - /** + /** * map of all array schemas * @return allArraySchemas - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "map of all array schemas") - public Map getAllArraySchemas() { return allArraySchemas; } - public void setAllArraySchemas(Map allArraySchemas) { this.allArraySchemas = allArraySchemas; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public LoadArraySchemaResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -155,13 +122,12 @@ public boolean equals(Object o) { } LoadArraySchemaResponse loadArraySchemaResponse = (LoadArraySchemaResponse) o; return Objects.equals(this.latestArraySchema, loadArraySchemaResponse.latestArraySchema) && - Objects.equals(this.allArraySchemas, loadArraySchemaResponse.allArraySchemas)&& - Objects.equals(this.additionalProperties, loadArraySchemaResponse.additionalProperties); + Objects.equals(this.allArraySchemas, loadArraySchemaResponse.allArraySchemas); } @Override public int hashCode() { - return Objects.hash(latestArraySchema, allArraySchemas, additionalProperties); + return Objects.hash(latestArraySchema, allArraySchemas); } @Override @@ -170,7 +136,6 @@ public String toString() { sb.append("class LoadArraySchemaResponse {\n"); sb.append(" latestArraySchema: ").append(toIndentedString(latestArraySchema)).append("\n"); sb.append(" allArraySchemas: ").append(toIndentedString(allArraySchemas)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -200,23 +165,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to LoadArraySchemaResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (LoadArraySchemaResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 LoadArraySchemaResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoadArraySchemaResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in LoadArraySchemaResponse is not found in the empty JSON string", LoadArraySchemaResponse.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LoadArraySchemaResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LoadArraySchemaResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `latest_array_schema` - if (jsonObj.getAsJsonObject("latest_array_schema") != null) { - ArraySchema.validateJsonObject(jsonObj.getAsJsonObject("latest_array_schema")); + if (jsonObj.get("latest_array_schema") != null && !jsonObj.get("latest_array_schema").isJsonNull()) { + ArraySchema.validateJsonElement(jsonObj.get("latest_array_schema")); } } @@ -235,71 +207,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, LoadArraySchemaResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public LoadArraySchemaResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - LoadArraySchemaResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of LoadArraySchemaResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of LoadArraySchemaResponse - * @throws IOException if the JSON string is invalid with respect to LoadArraySchemaResponse - */ + /** + * Create an instance of LoadArraySchemaResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoadArraySchemaResponse + * @throws IOException if the JSON string is invalid with respect to LoadArraySchemaResponse + */ public static LoadArraySchemaResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LoadArraySchemaResponse.class); } - /** - * Convert an instance of LoadArraySchemaResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LoadArraySchemaResponse 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/model/LoadEnumerationsRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequest.java index eb22023..af42919 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequest.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TileDBConfig; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +52,7 @@ /** * Request to return enumerations for attributes */ -@ApiModel(description = "Request to return enumerations for attributes") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class LoadEnumerationsRequest { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) @@ -52,36 +60,31 @@ public class LoadEnumerationsRequest { public static final String SERIALIZED_NAME_ENUMERATIONS = "enumerations"; @SerializedName(SERIALIZED_NAME_ENUMERATIONS) - private List enumerations = null; + private List enumerations = new ArrayList<>(); - public LoadEnumerationsRequest() { + public LoadEnumerationsRequest() { } public LoadEnumerationsRequest config(TileDBConfig config) { - this.config = config; return this; } - /** + /** * Get config * @return config - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TileDBConfig getConfig() { return config; } - public void setConfig(TileDBConfig config) { this.config = config; } public LoadEnumerationsRequest enumerations(List enumerations) { - this.enumerations = enumerations; return this; } @@ -94,57 +97,19 @@ public LoadEnumerationsRequest addEnumerationsItem(String enumerationsItem) { return this; } - /** + /** * Get enumerations * @return enumerations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getEnumerations() { return enumerations; } - public void setEnumerations(List enumerations) { this.enumerations = enumerations; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public LoadEnumerationsRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +122,12 @@ public boolean equals(Object o) { } LoadEnumerationsRequest loadEnumerationsRequest = (LoadEnumerationsRequest) o; return Objects.equals(this.config, loadEnumerationsRequest.config) && - Objects.equals(this.enumerations, loadEnumerationsRequest.enumerations)&& - Objects.equals(this.additionalProperties, loadEnumerationsRequest.additionalProperties); + Objects.equals(this.enumerations, loadEnumerationsRequest.enumerations); } @Override public int hashCode() { - return Objects.hash(config, enumerations, additionalProperties); + return Objects.hash(config, enumerations); } @Override @@ -172,7 +136,6 @@ public String toString() { sb.append("class LoadEnumerationsRequest {\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); sb.append(" enumerations: ").append(toIndentedString(enumerations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,26 +165,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to LoadEnumerationsRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (LoadEnumerationsRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 LoadEnumerationsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoadEnumerationsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in LoadEnumerationsRequest is not found in the empty JSON string", LoadEnumerationsRequest.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LoadEnumerationsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LoadEnumerationsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `config` - if (jsonObj.getAsJsonObject("config") != null) { - TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + TileDBConfig.validateJsonElement(jsonObj.get("config")); } - // ensure the json data is an array - if (jsonObj.get("enumerations") != null && !jsonObj.get("enumerations").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("enumerations") != null && !jsonObj.get("enumerations").isJsonNull() && !jsonObj.get("enumerations").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `enumerations` to be an array in the JSON string but got `%s`", jsonObj.get("enumerations").toString())); } } @@ -241,71 +211,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, LoadEnumerationsRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public LoadEnumerationsRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - LoadEnumerationsRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of LoadEnumerationsRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of LoadEnumerationsRequest - * @throws IOException if the JSON string is invalid with respect to LoadEnumerationsRequest - */ + /** + * Create an instance of LoadEnumerationsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoadEnumerationsRequest + * @throws IOException if the JSON string is invalid with respect to LoadEnumerationsRequest + */ public static LoadEnumerationsRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LoadEnumerationsRequest.class); } - /** - * Convert an instance of LoadEnumerationsRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LoadEnumerationsRequest 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/model/LoadEnumerationsResponse.java b/src/main/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponse.java index fece679..def76b0 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponse.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponse.java @@ -14,47 +14,54 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Enumeration; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Contains the enumerations of the array's attributes */ -@ApiModel(description = "Contains the enumerations of the array's attributes") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class LoadEnumerationsResponse { public static final String SERIALIZED_NAME_ENUMERATIONS = "enumerations"; @SerializedName(SERIALIZED_NAME_ENUMERATIONS) - private List enumerations = null; + private List enumerations = new ArrayList<>(); - public LoadEnumerationsResponse() { + public LoadEnumerationsResponse() { } public LoadEnumerationsResponse enumerations(List enumerations) { - this.enumerations = enumerations; return this; } @@ -67,57 +74,19 @@ public LoadEnumerationsResponse addEnumerationsItem(Enumeration enumerationsItem return this; } - /** + /** * Get enumerations * @return enumerations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getEnumerations() { return enumerations; } - public void setEnumerations(List enumerations) { this.enumerations = enumerations; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public LoadEnumerationsResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -129,13 +98,12 @@ public boolean equals(Object o) { return false; } LoadEnumerationsResponse loadEnumerationsResponse = (LoadEnumerationsResponse) o; - return Objects.equals(this.enumerations, loadEnumerationsResponse.enumerations)&& - Objects.equals(this.additionalProperties, loadEnumerationsResponse.additionalProperties); + return Objects.equals(this.enumerations, loadEnumerationsResponse.enumerations); } @Override public int hashCode() { - return Objects.hash(enumerations, additionalProperties); + return Objects.hash(enumerations); } @Override @@ -143,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LoadEnumerationsResponse {\n"); sb.append(" enumerations: ").append(toIndentedString(enumerations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -172,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to LoadEnumerationsResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (LoadEnumerationsResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 LoadEnumerationsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoadEnumerationsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in LoadEnumerationsResponse is not found in the empty JSON string", LoadEnumerationsResponse.openapiRequiredFields.toString())); } } - JsonArray jsonArrayenumerations = jsonObj.getAsJsonArray("enumerations"); - if (jsonArrayenumerations != null) { - // ensure the json data is an array - if (!jsonObj.get("enumerations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `enumerations` to be an array in the JSON string but got `%s`", jsonObj.get("enumerations").toString())); - } - // validate the optional field `enumerations` (array) - for (int i = 0; i < jsonArrayenumerations.size(); i++) { - Enumeration.validateJsonObject(jsonArrayenumerations.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LoadEnumerationsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LoadEnumerationsResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("enumerations") != null && !jsonObj.get("enumerations").isJsonNull()) { + JsonArray jsonArrayenumerations = jsonObj.getAsJsonArray("enumerations"); + if (jsonArrayenumerations != null) { + // ensure the json data is an array + if (!jsonObj.get("enumerations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `enumerations` to be an array in the JSON string but got `%s`", jsonObj.get("enumerations").toString())); + } + + // validate the optional field `enumerations` (array) + for (int i = 0; i < jsonArrayenumerations.size(); i++) { + Enumeration.validateJsonElement(jsonArrayenumerations.get(i)); + }; + } } } @@ -215,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, LoadEnumerationsResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public LoadEnumerationsResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - LoadEnumerationsResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of LoadEnumerationsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of LoadEnumerationsResponse - * @throws IOException if the JSON string is invalid with respect to LoadEnumerationsResponse - */ + /** + * Create an instance of LoadEnumerationsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoadEnumerationsResponse + * @throws IOException if the JSON string is invalid with respect to LoadEnumerationsResponse + */ public static LoadEnumerationsResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LoadEnumerationsResponse.class); } - /** - * Convert an instance of LoadEnumerationsResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LoadEnumerationsResponse 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/model/MLModelFavorite.java b/src/main/java/io/tiledb/cloud/rest_api/model/MLModelFavorite.java index 774f36a..2ce3a1c 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/MLModelFavorite.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/MLModelFavorite.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * A user-favorite MLModel item */ -@ApiModel(description = "A user-favorite MLModel item") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MLModelFavorite { public static final String SERIALIZED_NAME_MLMODEL_UUID = "mlmodel_uuid"; @SerializedName(SERIALIZED_NAME_MLMODEL_UUID) @@ -56,112 +63,65 @@ public class MLModelFavorite { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public MLModelFavorite() { + public MLModelFavorite() { } public MLModelFavorite mlmodelUuid(String mlmodelUuid) { - this.mlmodelUuid = mlmodelUuid; return this; } - /** + /** * unique UUID of the MLModel * @return mlmodelUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "unique UUID of the MLModel") - public String getMlmodelUuid() { return mlmodelUuid; } - public void setMlmodelUuid(String mlmodelUuid) { this.mlmodelUuid = mlmodelUuid; } public MLModelFavorite namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * the namespace of the MLModel * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the namespace of the MLModel") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public MLModelFavorite name(String name) { - this.name = name; return this; } - /** + /** * the name of the MLModel * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the MLModel") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public MLModelFavorite putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { MLModelFavorite mlModelFavorite = (MLModelFavorite) o; return Objects.equals(this.mlmodelUuid, mlModelFavorite.mlmodelUuid) && Objects.equals(this.namespace, mlModelFavorite.namespace) && - Objects.equals(this.name, mlModelFavorite.name)&& - Objects.equals(this.additionalProperties, mlModelFavorite.additionalProperties); + Objects.equals(this.name, mlModelFavorite.name); } @Override public int hashCode() { - return Objects.hash(mlmodelUuid, namespace, name, additionalProperties); + return Objects.hash(mlmodelUuid, namespace, name); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" mlmodelUuid: ").append(toIndentedString(mlmodelUuid)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MLModelFavorite - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MLModelFavorite.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 MLModelFavorite + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MLModelFavorite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MLModelFavorite is not found in the empty JSON string", MLModelFavorite.openapiRequiredFields.toString())); } } - if (jsonObj.get("mlmodel_uuid") != null && !jsonObj.get("mlmodel_uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MLModelFavorite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MLModelFavorite` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("mlmodel_uuid") != null && !jsonObj.get("mlmodel_uuid").isJsonNull()) && !jsonObj.get("mlmodel_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `mlmodel_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mlmodel_uuid").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MLModelFavorite value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public MLModelFavorite read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - MLModelFavorite instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MLModelFavorite given an JSON string - * - * @param jsonString JSON string - * @return An instance of MLModelFavorite - * @throws IOException if the JSON string is invalid with respect to MLModelFavorite - */ + /** + * Create an instance of MLModelFavorite given an JSON string + * + * @param jsonString JSON string + * @return An instance of MLModelFavorite + * @throws IOException if the JSON string is invalid with respect to MLModelFavorite + */ public static MLModelFavorite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MLModelFavorite.class); } - /** - * Convert an instance of MLModelFavorite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MLModelFavorite 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/model/MLModelFavoritesData.java b/src/main/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesData.java index 9c0368c..ba52b4f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesData.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Object including MLModel favorites and pagination metadata */ -@ApiModel(description = "Object including MLModel favorites and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MLModelFavoritesData { public static final String SERIALIZED_NAME_MLMODELS = "mlmodels"; @SerializedName(SERIALIZED_NAME_MLMODELS) - private List mlmodels = null; + private List mlmodels = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public MLModelFavoritesData() { + public MLModelFavoritesData() { } public MLModelFavoritesData mlmodels(List mlmodels) { - this.mlmodels = mlmodels; return this; } @@ -72,80 +79,38 @@ public MLModelFavoritesData addMlmodelsItem(ArrayInfo mlmodelsItem) { return this; } - /** + /** * List of MLModel infos * @return mlmodels - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of MLModel infos") - public List getMlmodels() { return mlmodels; } - public void setMlmodels(List mlmodels) { this.mlmodels = mlmodels; } public MLModelFavoritesData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public MLModelFavoritesData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } MLModelFavoritesData mlModelFavoritesData = (MLModelFavoritesData) o; return Objects.equals(this.mlmodels, mlModelFavoritesData.mlmodels) && - Objects.equals(this.paginationMetadata, mlModelFavoritesData.paginationMetadata)&& - Objects.equals(this.additionalProperties, mlModelFavoritesData.additionalProperties); + Objects.equals(this.paginationMetadata, mlModelFavoritesData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(mlmodels, paginationMetadata, additionalProperties); + return Objects.hash(mlmodels, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class MLModelFavoritesData {\n"); sb.append(" mlmodels: ").append(toIndentedString(mlmodels)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MLModelFavoritesData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MLModelFavoritesData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 MLModelFavoritesData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MLModelFavoritesData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MLModelFavoritesData is not found in the empty JSON string", MLModelFavoritesData.openapiRequiredFields.toString())); } } - JsonArray jsonArraymlmodels = jsonObj.getAsJsonArray("mlmodels"); - if (jsonArraymlmodels != null) { - // ensure the json data is an array - if (!jsonObj.get("mlmodels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `mlmodels` to be an array in the JSON string but got `%s`", jsonObj.get("mlmodels").toString())); - } - // validate the optional field `mlmodels` (array) - for (int i = 0; i < jsonArraymlmodels.size(); i++) { - ArrayInfo.validateJsonObject(jsonArraymlmodels.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MLModelFavoritesData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MLModelFavoritesData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("mlmodels") != null && !jsonObj.get("mlmodels").isJsonNull()) { + JsonArray jsonArraymlmodels = jsonObj.getAsJsonArray("mlmodels"); + if (jsonArraymlmodels != null) { + // ensure the json data is an array + if (!jsonObj.get("mlmodels").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `mlmodels` to be an array in the JSON string but got `%s`", jsonObj.get("mlmodels").toString())); + } + + // validate the optional field `mlmodels` (array) + for (int i = 0; i < jsonArraymlmodels.size(); i++) { + ArrayInfo.validateJsonElement(jsonArraymlmodels.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MLModelFavoritesData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public MLModelFavoritesData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - MLModelFavoritesData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MLModelFavoritesData given an JSON string - * - * @param jsonString JSON string - * @return An instance of MLModelFavoritesData - * @throws IOException if the JSON string is invalid with respect to MLModelFavoritesData - */ + /** + * Create an instance of MLModelFavoritesData given an JSON string + * + * @param jsonString JSON string + * @return An instance of MLModelFavoritesData + * @throws IOException if the JSON string is invalid with respect to MLModelFavoritesData + */ public static MLModelFavoritesData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MLModelFavoritesData.class); } - /** - * Convert an instance of MLModelFavoritesData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MLModelFavoritesData 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/model/MaxBufferSizes.java b/src/main/java/io/tiledb/cloud/rest_api/model/MaxBufferSizes.java index 505df72..a22aa55 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/MaxBufferSizes.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/MaxBufferSizes.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AttributeBufferSize; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,18 +52,16 @@ /** * a list of max buffer sizes, one per attribute */ -@ApiModel(description = "a list of max buffer sizes, one per attribute") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MaxBufferSizes { public static final String SERIALIZED_NAME_MAX_BUFFER_SIZES = "maxBufferSizes"; @SerializedName(SERIALIZED_NAME_MAX_BUFFER_SIZES) - private List maxBufferSizes = null; + private List maxBufferSizes = new ArrayList<>(); - public MaxBufferSizes() { + public MaxBufferSizes() { } public MaxBufferSizes maxBufferSizes(List maxBufferSizes) { - this.maxBufferSizes = maxBufferSizes; return this; } @@ -68,57 +74,19 @@ public MaxBufferSizes addMaxBufferSizesItem(AttributeBufferSize maxBufferSizesIt return this; } - /** + /** * Get maxBufferSizes * @return maxBufferSizes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getMaxBufferSizes() { return maxBufferSizes; } - public void setMaxBufferSizes(List maxBufferSizes) { this.maxBufferSizes = maxBufferSizes; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public MaxBufferSizes putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -130,13 +98,12 @@ public boolean equals(Object o) { return false; } MaxBufferSizes maxBufferSizes = (MaxBufferSizes) o; - return Objects.equals(this.maxBufferSizes, maxBufferSizes.maxBufferSizes)&& - Objects.equals(this.additionalProperties, maxBufferSizes.additionalProperties); + return Objects.equals(this.maxBufferSizes, maxBufferSizes.maxBufferSizes); } @Override public int hashCode() { - return Objects.hash(maxBufferSizes, additionalProperties); + return Objects.hash(maxBufferSizes); } @Override @@ -144,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MaxBufferSizes {\n"); sb.append(" maxBufferSizes: ").append(toIndentedString(maxBufferSizes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -173,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MaxBufferSizes - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MaxBufferSizes.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 MaxBufferSizes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MaxBufferSizes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MaxBufferSizes is not found in the empty JSON string", MaxBufferSizes.openapiRequiredFields.toString())); } } - JsonArray jsonArraymaxBufferSizes = jsonObj.getAsJsonArray("maxBufferSizes"); - if (jsonArraymaxBufferSizes != null) { - // ensure the json data is an array - if (!jsonObj.get("maxBufferSizes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `maxBufferSizes` to be an array in the JSON string but got `%s`", jsonObj.get("maxBufferSizes").toString())); - } - // validate the optional field `maxBufferSizes` (array) - for (int i = 0; i < jsonArraymaxBufferSizes.size(); i++) { - AttributeBufferSize.validateJsonObject(jsonArraymaxBufferSizes.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MaxBufferSizes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MaxBufferSizes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("maxBufferSizes") != null && !jsonObj.get("maxBufferSizes").isJsonNull()) { + JsonArray jsonArraymaxBufferSizes = jsonObj.getAsJsonArray("maxBufferSizes"); + if (jsonArraymaxBufferSizes != null) { + // ensure the json data is an array + if (!jsonObj.get("maxBufferSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `maxBufferSizes` to be an array in the JSON string but got `%s`", jsonObj.get("maxBufferSizes").toString())); + } + + // validate the optional field `maxBufferSizes` (array) + for (int i = 0; i < jsonArraymaxBufferSizes.size(); i++) { + AttributeBufferSize.validateJsonElement(jsonArraymaxBufferSizes.get(i)); + }; + } } } @@ -216,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MaxBufferSizes value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public MaxBufferSizes read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - MaxBufferSizes instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MaxBufferSizes given an JSON string - * - * @param jsonString JSON string - * @return An instance of MaxBufferSizes - * @throws IOException if the JSON string is invalid with respect to MaxBufferSizes - */ + /** + * Create an instance of MaxBufferSizes given an JSON string + * + * @param jsonString JSON string + * @return An instance of MaxBufferSizes + * @throws IOException if the JSON string is invalid with respect to MaxBufferSizes + */ public static MaxBufferSizes fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MaxBufferSizes.class); } - /** - * Convert an instance of MaxBufferSizes to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MaxBufferSizes 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/model/MetadataStringified.java b/src/main/java/io/tiledb/cloud/rest_api/model/MetadataStringified.java index e28fb01..d24b4b8 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/MetadataStringified.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/MetadataStringified.java @@ -14,47 +14,54 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.MetadataStringifiedEntry; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * The user's TileDB metadata */ -@ApiModel(description = "The user's TileDB metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MetadataStringified { public static final String SERIALIZED_NAME_ENTRIES = "entries"; @SerializedName(SERIALIZED_NAME_ENTRIES) - private List entries = null; + private List entries = new ArrayList<>(); - public MetadataStringified() { + public MetadataStringified() { } public MetadataStringified entries(List entries) { - this.entries = entries; return this; } @@ -67,57 +74,19 @@ public MetadataStringified addEntriesItem(MetadataStringifiedEntry entriesItem) return this; } - /** + /** * List of metadata entries * @return entries - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of metadata entries") - public List getEntries() { return entries; } - public void setEntries(List entries) { this.entries = entries; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public MetadataStringified putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -129,13 +98,12 @@ public boolean equals(Object o) { return false; } MetadataStringified metadataStringified = (MetadataStringified) o; - return Objects.equals(this.entries, metadataStringified.entries)&& - Objects.equals(this.additionalProperties, metadataStringified.additionalProperties); + return Objects.equals(this.entries, metadataStringified.entries); } @Override public int hashCode() { - return Objects.hash(entries, additionalProperties); + return Objects.hash(entries); } @Override @@ -143,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MetadataStringified {\n"); sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -172,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MetadataStringified - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MetadataStringified.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 MetadataStringified + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MetadataStringified.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MetadataStringified is not found in the empty JSON string", MetadataStringified.openapiRequiredFields.toString())); } } - JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); - if (jsonArrayentries != null) { - // ensure the json data is an array - 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())); - } - // validate the optional field `entries` (array) - for (int i = 0; i < jsonArrayentries.size(); i++) { - MetadataStringifiedEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MetadataStringified.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MetadataStringified` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + MetadataStringifiedEntry.validateJsonElement(jsonArrayentries.get(i)); + }; + } } } @@ -215,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MetadataStringified value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public MetadataStringified read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - MetadataStringified instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MetadataStringified given an JSON string - * - * @param jsonString JSON string - * @return An instance of MetadataStringified - * @throws IOException if the JSON string is invalid with respect to MetadataStringified - */ + /** + * Create an instance of MetadataStringified given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetadataStringified + * @throws IOException if the JSON string is invalid with respect to MetadataStringified + */ public static MetadataStringified fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MetadataStringified.class); } - /** - * Convert an instance of MetadataStringified to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MetadataStringified 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/model/MetadataStringifiedEntry.java b/src/main/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntry.java index f77ce7b..58fbc2a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntry.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntry.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * key/value pair representing an asset metadata map entry */ -@ApiModel(description = "key/value pair representing an asset metadata map entry") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MetadataStringifiedEntry { public static final String SERIALIZED_NAME_KEY = "key"; @SerializedName(SERIALIZED_NAME_KEY) @@ -56,112 +63,65 @@ public class MetadataStringifiedEntry { @SerializedName(SERIALIZED_NAME_TYPE) private String type; - public MetadataStringifiedEntry() { + public MetadataStringifiedEntry() { } public MetadataStringifiedEntry key(String key) { - this.key = key; return this; } - /** + /** * The metadata key * @return key - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The metadata key") - public String getKey() { return key; } - public void setKey(String key) { this.key = key; } public MetadataStringifiedEntry value(String value) { - this.value = value; return this; } - /** + /** * The metadata value * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The metadata value") - public String getValue() { return value; } - public void setValue(String value) { this.value = value; } public MetadataStringifiedEntry type(String type) { - this.type = type; return this; } - /** + /** * The metadata type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "array_metadata", value = "The metadata type") - public String getType() { return type; } - public void setType(String type) { this.type = type; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public MetadataStringifiedEntry putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { MetadataStringifiedEntry metadataStringifiedEntry = (MetadataStringifiedEntry) o; return Objects.equals(this.key, metadataStringifiedEntry.key) && Objects.equals(this.value, metadataStringifiedEntry.value) && - Objects.equals(this.type, metadataStringifiedEntry.type)&& - Objects.equals(this.additionalProperties, metadataStringifiedEntry.additionalProperties); + Objects.equals(this.type, metadataStringifiedEntry.type); } @Override public int hashCode() { - return Objects.hash(key, value, type, additionalProperties); + return Objects.hash(key, value, type); } @Override @@ -191,7 +150,6 @@ public String toString() { 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MetadataStringifiedEntry - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MetadataStringifiedEntry.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 MetadataStringifiedEntry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MetadataStringifiedEntry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MetadataStringifiedEntry is not found in the empty JSON string", MetadataStringifiedEntry.openapiRequiredFields.toString())); } } - if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MetadataStringifiedEntry.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MetadataStringifiedEntry` 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("value") != null && !jsonObj.get("value").isJsonPrimitive()) { + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !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())); } - if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !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())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MetadataStringifiedEntry value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public MetadataStringifiedEntry read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - MetadataStringifiedEntry instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MetadataStringifiedEntry given an JSON string - * - * @param jsonString JSON string - * @return An instance of MetadataStringifiedEntry - * @throws IOException if the JSON string is invalid with respect to MetadataStringifiedEntry - */ + /** + * Create an instance of MetadataStringifiedEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetadataStringifiedEntry + * @throws IOException if the JSON string is invalid with respect to MetadataStringifiedEntry + */ public static MetadataStringifiedEntry fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MetadataStringifiedEntry.class); } - /** - * Convert an instance of MetadataStringifiedEntry to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MetadataStringifiedEntry 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/model/MultiArrayUDF.java b/src/main/java/io/tiledb/cloud/rest_api/model/MultiArrayUDF.java index 7fd1c5b..71cfdbf 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/MultiArrayUDF.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/MultiArrayUDF.java @@ -14,39 +14,51 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.QueryRanges; +import io.tiledb.cloud.rest_api.model.ResultFormat; +import io.tiledb.cloud.rest_api.model.TGUDFArgument; +import io.tiledb.cloud.rest_api.model.UDFArrayDetails; +import io.tiledb.cloud.rest_api.model.UDFLanguage; +import io.tiledb.cloud.rest_api.model.UDFSubarray; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * User-defined function */ -@ApiModel(description = "User-defined function") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MultiArrayUDF { public static final String SERIALIZED_NAME_UDF_INFO_NAME = "udf_info_name"; @SerializedName(SERIALIZED_NAME_UDF_INFO_NAME) @@ -94,11 +106,11 @@ public class MultiArrayUDF { public static final String SERIALIZED_NAME_ARGUMENTS_JSON = "arguments_json"; @SerializedName(SERIALIZED_NAME_ARGUMENTS_JSON) - private List argumentsJson = null; + private List argumentsJson; public static final String SERIALIZED_NAME_STORED_PARAM_UUIDS = "stored_param_uuids"; @SerializedName(SERIALIZED_NAME_STORED_PARAM_UUIDS) - private List storedParamUuids = null; + private List storedParamUuids = new ArrayList<>(); public static final String SERIALIZED_NAME_STORE_RESULTS = "store_results"; @SerializedName(SERIALIZED_NAME_STORE_RESULTS) @@ -118,11 +130,11 @@ public class MultiArrayUDF { public static final String SERIALIZED_NAME_BUFFERS = "buffers"; @SerializedName(SERIALIZED_NAME_BUFFERS) - private List buffers = null; + private List buffers = new ArrayList<>(); public static final String SERIALIZED_NAME_ARRAYS = "arrays"; @SerializedName(SERIALIZED_NAME_ARRAYS) - private List arrays = null; + private List arrays = new ArrayList<>(); public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; @SerializedName(SERIALIZED_NAME_TIMEOUT) @@ -136,264 +148,219 @@ public class MultiArrayUDF { @SerializedName(SERIALIZED_NAME_CLIENT_NODE_UUID) private String clientNodeUuid; - public MultiArrayUDF() { + public MultiArrayUDF() { } public MultiArrayUDF udfInfoName(String udfInfoName) { - this.udfInfoName = udfInfoName; return this; } - /** + /** * name of UDFInfo to run, format is {namespace}/{udf_name}. Can not be used with exec * @return udfInfoName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "TileDB-Inc/quickstart_median", value = "name of UDFInfo to run, format is {namespace}/{udf_name}. Can not be used with exec") - public String getUdfInfoName() { return udfInfoName; } - public void setUdfInfoName(String udfInfoName) { this.udfInfoName = udfInfoName; } public MultiArrayUDF language(UDFLanguage language) { - this.language = language; return this; } - /** + /** * Get language * @return language - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFLanguage getLanguage() { return language; } - public void setLanguage(UDFLanguage language) { this.language = language; } public MultiArrayUDF version(String version) { - this.version = version; return this; } - /** + /** * Type-specific version * @return version - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Type-specific version") - public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } public MultiArrayUDF imageName(String imageName) { - this.imageName = imageName; return this; } - /** + /** * Docker image name to use for UDF * @return imageName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Docker image name to use for UDF") - public String getImageName() { return imageName; } - public void setImageName(String imageName) { this.imageName = imageName; } public MultiArrayUDF accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * The name of the access credentials to use. if unset, no credentials will be configured in the environment. * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the access credentials to use. if unset, no credentials will be configured in the environment.") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public MultiArrayUDF resourceClass(String resourceClass) { - this.resourceClass = resourceClass; return this; } - /** + /** * The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the UDF will execute in the standard resource class of the TileDB Cloud provider. * @return resourceClass - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "standard", value = "The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the UDF will execute in the standard resource class of the TileDB Cloud provider. ") - public String getResourceClass() { return resourceClass; } - public void setResourceClass(String resourceClass) { this.resourceClass = resourceClass; } public MultiArrayUDF exec(String exec) { - this.exec = exec; return this; } - /** + /** * Type-specific executable text * @return exec - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Type-specific executable text") - public String getExec() { return exec; } - public void setExec(String exec) { this.exec = exec; } public MultiArrayUDF execRaw(String execRaw) { - this.execRaw = execRaw; return this; } - /** + /** * optional raw text to store of serialized function, used for showing in UI * @return execRaw - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional raw text to store of serialized function, used for showing in UI") - public String getExecRaw() { return execRaw; } - public void setExecRaw(String execRaw) { this.execRaw = execRaw; } public MultiArrayUDF resultFormat(ResultFormat resultFormat) { - this.resultFormat = resultFormat; return this; } - /** + /** * Get resultFormat * @return resultFormat - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ResultFormat getResultFormat() { return resultFormat; } - public void setResultFormat(ResultFormat resultFormat) { this.resultFormat = resultFormat; } public MultiArrayUDF taskName(String taskName) { - this.taskName = taskName; return this; } - /** + /** * name of task, optional * @return taskName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of task, optional") - public String getTaskName() { return taskName; } - public void setTaskName(String taskName) { this.taskName = taskName; } public MultiArrayUDF argument(String argument) { - this.argument = argument; return this; } - /** + /** * Deprecated: Prefer to use `argument_json` instead. Argument(s) to pass to UDF function, tuple or list of args/kwargs which can be in native or JSON format * @return argument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Deprecated: Prefer to use `argument_json` instead. Argument(s) to pass to UDF function, tuple or list of args/kwargs which can be in native or JSON format ") - public String getArgument() { return argument; } - public void setArgument(String argument) { this.argument = argument; } public MultiArrayUDF argumentsJson(List argumentsJson) { - this.argumentsJson = argumentsJson; return this; } @@ -406,25 +373,21 @@ public MultiArrayUDF addArgumentsJsonItem(TGUDFArgument argumentsJsonItem) { return this; } - /** + /** * A series of key-value pairs to be passed as arguments into the UDF. See `TGUDFNodeData.arguments` for more information. If this format is used to pass arguments, arrays will be passed into the UDF as specified by the Node placeholders passed in here, rather than the classic method of putting all array arguments in the first parameter. Either this or `argument` should be set. * @return argumentsJson - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A series of key-value pairs to be passed as arguments into the UDF. See `TGUDFNodeData.arguments` for more information. If this format is used to pass arguments, arrays will be passed into the UDF as specified by the Node placeholders passed in here, rather than the classic method of putting all array arguments in the first parameter. Either this or `argument` should be set. ") - public List getArgumentsJson() { return argumentsJson; } - public void setArgumentsJson(List argumentsJson) { this.argumentsJson = argumentsJson; } public MultiArrayUDF storedParamUuids(List storedParamUuids) { - this.storedParamUuids = storedParamUuids; return this; } @@ -437,117 +400,97 @@ public MultiArrayUDF addStoredParamUuidsItem(String storedParamUuidsItem) { return this; } - /** + /** * The UUIDs of stored input parameters (passed in a language-specific format within \"argument\") to be retrieved from the server-side cache. Serialized in standard hex format with no {}. * @return storedParamUuids - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The UUIDs of stored input parameters (passed in a language-specific format within \"argument\") to be retrieved from the server-side cache. Serialized in standard hex format with no {}.") - public List getStoredParamUuids() { return storedParamUuids; } - public void setStoredParamUuids(List storedParamUuids) { this.storedParamUuids = storedParamUuids; } public MultiArrayUDF storeResults(Boolean storeResults) { - this.storeResults = storeResults; return this; } - /** + /** * store results for later retrieval * @return storeResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "store results for later retrieval") - public Boolean getStoreResults() { return storeResults; } - public void setStoreResults(Boolean storeResults) { this.storeResults = storeResults; } public MultiArrayUDF dontDownloadResults(Boolean dontDownloadResults) { - this.dontDownloadResults = dontDownloadResults; return this; } - /** + /** * Set to true to avoid downloading the results of this UDF. Useful for intermediate nodes in a task graph where you will not be using the results of your function. Defaults to false (\"yes download results\"). * @return dontDownloadResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set to true to avoid downloading the results of this UDF. Useful for intermediate nodes in a task graph where you will not be using the results of your function. Defaults to false (\"yes download results\").") - public Boolean getDontDownloadResults() { return dontDownloadResults; } - public void setDontDownloadResults(Boolean dontDownloadResults) { this.dontDownloadResults = dontDownloadResults; } public MultiArrayUDF ranges(QueryRanges ranges) { - this.ranges = ranges; return this; } - /** + /** * Get ranges * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public QueryRanges getRanges() { return ranges; } - public void setRanges(QueryRanges ranges) { this.ranges = ranges; } public MultiArrayUDF subarray(UDFSubarray subarray) { - this.subarray = subarray; return this; } - /** + /** * Get subarray * @return subarray - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFSubarray getSubarray() { return subarray; } - public void setSubarray(UDFSubarray subarray) { this.subarray = subarray; } public MultiArrayUDF buffers(List buffers) { - this.buffers = buffers; return this; } @@ -560,25 +503,21 @@ public MultiArrayUDF addBuffersItem(String buffersItem) { return this; } - /** + /** * List of buffers to fetch (attributes + dimensions). Deprecated; please set arrays with `UDFArrayDetails`. * @return buffers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of buffers to fetch (attributes + dimensions). Deprecated; please set arrays with `UDFArrayDetails`.") - public List getBuffers() { return buffers; } - public void setBuffers(List buffers) { this.buffers = buffers; } public MultiArrayUDF arrays(List arrays) { - this.arrays = arrays; return this; } @@ -591,126 +530,76 @@ public MultiArrayUDF addArraysItem(UDFArrayDetails arraysItem) { return this; } - /** + /** * Array ranges/buffer into to run UDF on * @return arrays - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Array ranges/buffer into to run UDF on") - public List getArrays() { return arrays; } - public void setArrays(List arrays) { this.arrays = arrays; } public MultiArrayUDF timeout(Integer timeout) { - this.timeout = timeout; return this; } - /** + /** * UDF-type timeout in seconds (default: 900) * @return timeout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "UDF-type timeout in seconds (default: 900)") - public Integer getTimeout() { return timeout; } - public void setTimeout(Integer timeout) { this.timeout = timeout; } public MultiArrayUDF taskGraphUuid(String taskGraphUuid) { - this.taskGraphUuid = taskGraphUuid; return this; } - /** + /** * If set, the ID of the log for the task graph that this was part of. * @return taskGraphUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the ID of the log for the task graph that this was part of. ") - public String getTaskGraphUuid() { return taskGraphUuid; } - public void setTaskGraphUuid(String taskGraphUuid) { this.taskGraphUuid = taskGraphUuid; } public MultiArrayUDF clientNodeUuid(String clientNodeUuid) { - this.clientNodeUuid = clientNodeUuid; return this; } - /** + /** * If set, the client-defined ID of the node within this task's graph. * @return clientNodeUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the client-defined ID of the node within this task's graph. ") - public String getClientNodeUuid() { return clientNodeUuid; } - public void setClientNodeUuid(String clientNodeUuid) { this.clientNodeUuid = clientNodeUuid; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public MultiArrayUDF putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -743,8 +632,7 @@ public boolean equals(Object o) { Objects.equals(this.arrays, multiArrayUDF.arrays) && Objects.equals(this.timeout, multiArrayUDF.timeout) && Objects.equals(this.taskGraphUuid, multiArrayUDF.taskGraphUuid) && - Objects.equals(this.clientNodeUuid, multiArrayUDF.clientNodeUuid)&& - Objects.equals(this.additionalProperties, multiArrayUDF.additionalProperties); + Objects.equals(this.clientNodeUuid, multiArrayUDF.clientNodeUuid); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -753,7 +641,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(udfInfoName, language, version, imageName, accessCredentialsName, resourceClass, exec, execRaw, resultFormat, taskName, argument, argumentsJson, storedParamUuids, storeResults, dontDownloadResults, ranges, subarray, buffers, arrays, timeout, taskGraphUuid, clientNodeUuid, additionalProperties); + return Objects.hash(udfInfoName, language, version, imageName, accessCredentialsName, resourceClass, exec, execRaw, resultFormat, taskName, argument, argumentsJson, storedParamUuids, storeResults, dontDownloadResults, ranges, subarray, buffers, arrays, timeout, taskGraphUuid, clientNodeUuid); } private static int hashCodeNullable(JsonNullable a) { @@ -789,7 +677,6 @@ public String toString() { sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); sb.append(" taskGraphUuid: ").append(toIndentedString(taskGraphUuid)).append("\n"); sb.append(" clientNodeUuid: ").append(toIndentedString(clientNodeUuid)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -839,91 +726,110 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to MultiArrayUDF - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (MultiArrayUDF.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 MultiArrayUDF + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MultiArrayUDF.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in MultiArrayUDF is not found in the empty JSON string", MultiArrayUDF.openapiRequiredFields.toString())); } } - if (jsonObj.get("udf_info_name") != null && !jsonObj.get("udf_info_name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MultiArrayUDF.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MultiArrayUDF` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("udf_info_name") != null && !jsonObj.get("udf_info_name").isJsonNull()) && !jsonObj.get("udf_info_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `udf_info_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("udf_info_name").toString())); } - if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonPrimitive()) { + // validate the optional field `language` + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) { + UDFLanguage.validateJsonElement(jsonObj.get("language")); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } - if (jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonPrimitive()) { + if ((jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonNull()) && !jsonObj.get("image_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `image_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_name").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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("resource_class") != null && !jsonObj.get("resource_class").isJsonPrimitive()) { + if ((jsonObj.get("resource_class") != null && !jsonObj.get("resource_class").isJsonNull()) && !jsonObj.get("resource_class").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `resource_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource_class").toString())); } - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonPrimitive()) { + if ((jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) && !jsonObj.get("exec").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exec").toString())); } - if (jsonObj.get("exec_raw") != null && !jsonObj.get("exec_raw").isJsonPrimitive()) { + if ((jsonObj.get("exec_raw") != null && !jsonObj.get("exec_raw").isJsonNull()) && !jsonObj.get("exec_raw").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exec_raw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exec_raw").toString())); } - if (jsonObj.get("task_name") != null && !jsonObj.get("task_name").isJsonPrimitive()) { + // validate the optional field `result_format` + if (jsonObj.get("result_format") != null && !jsonObj.get("result_format").isJsonNull()) { + ResultFormat.validateJsonElement(jsonObj.get("result_format")); + } + if ((jsonObj.get("task_name") != null && !jsonObj.get("task_name").isJsonNull()) && !jsonObj.get("task_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `task_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_name").toString())); } - if (jsonObj.get("argument") != null && !jsonObj.get("argument").isJsonPrimitive()) { + if ((jsonObj.get("argument") != null && !jsonObj.get("argument").isJsonNull()) && !jsonObj.get("argument").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `argument` to be a primitive type in the JSON string but got `%s`", jsonObj.get("argument").toString())); } - JsonArray jsonArrayargumentsJson = jsonObj.getAsJsonArray("arguments_json"); - if (jsonArrayargumentsJson != null) { - // ensure the json data is an array - if (!jsonObj.get("arguments_json").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `arguments_json` to be an array in the JSON string but got `%s`", jsonObj.get("arguments_json").toString())); + if (jsonObj.get("arguments_json") != null && !jsonObj.get("arguments_json").isJsonNull()) { + JsonArray jsonArrayargumentsJson = jsonObj.getAsJsonArray("arguments_json"); + if (jsonArrayargumentsJson != null) { + // ensure the json data is an array + if (!jsonObj.get("arguments_json").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arguments_json` to be an array in the JSON string but got `%s`", jsonObj.get("arguments_json").toString())); + } + + // validate the optional field `arguments_json` (array) + for (int i = 0; i < jsonArrayargumentsJson.size(); i++) { + TGUDFArgument.validateJsonElement(jsonArrayargumentsJson.get(i)); + }; } - - // validate the optional field `arguments_json` (array) - for (int i = 0; i < jsonArrayargumentsJson.size(); i++) { - TGUDFArgument.validateJsonObject(jsonArrayargumentsJson.get(i).getAsJsonObject()); - }; } - // ensure the json data is an array - if (jsonObj.get("stored_param_uuids") != null && !jsonObj.get("stored_param_uuids").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("stored_param_uuids") != null && !jsonObj.get("stored_param_uuids").isJsonNull() && !jsonObj.get("stored_param_uuids").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `stored_param_uuids` to be an array in the JSON string but got `%s`", jsonObj.get("stored_param_uuids").toString())); } // validate the optional field `ranges` - if (jsonObj.getAsJsonObject("ranges") != null) { - QueryRanges.validateJsonObject(jsonObj.getAsJsonObject("ranges")); + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull()) { + QueryRanges.validateJsonElement(jsonObj.get("ranges")); } // validate the optional field `subarray` - if (jsonObj.getAsJsonObject("subarray") != null) { - UDFSubarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + if (jsonObj.get("subarray") != null && !jsonObj.get("subarray").isJsonNull()) { + UDFSubarray.validateJsonElement(jsonObj.get("subarray")); } - // ensure the json data is an array - if (jsonObj.get("buffers") != null && !jsonObj.get("buffers").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("buffers") != null && !jsonObj.get("buffers").isJsonNull() && !jsonObj.get("buffers").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `buffers` to be an array in the JSON string but got `%s`", jsonObj.get("buffers").toString())); } - JsonArray jsonArrayarrays = jsonObj.getAsJsonArray("arrays"); - if (jsonArrayarrays != null) { - // ensure the json data is an array - if (!jsonObj.get("arrays").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `arrays` to be an array in the JSON string but got `%s`", jsonObj.get("arrays").toString())); + if (jsonObj.get("arrays") != null && !jsonObj.get("arrays").isJsonNull()) { + JsonArray jsonArrayarrays = jsonObj.getAsJsonArray("arrays"); + if (jsonArrayarrays != null) { + // ensure the json data is an array + if (!jsonObj.get("arrays").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrays` to be an array in the JSON string but got `%s`", jsonObj.get("arrays").toString())); + } + + // validate the optional field `arrays` (array) + for (int i = 0; i < jsonArrayarrays.size(); i++) { + UDFArrayDetails.validateJsonElement(jsonArrayarrays.get(i)); + }; } - - // validate the optional field `arrays` (array) - for (int i = 0; i < jsonArrayarrays.size(); i++) { - UDFArrayDetails.validateJsonObject(jsonArrayarrays.get(i).getAsJsonObject()); - }; } - if (jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { + if ((jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonNull()) && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `task_graph_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_graph_uuid").toString())); } - if (jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { + if ((jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonNull()) && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `client_node_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_uuid").toString())); } } @@ -943,71 +849,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MultiArrayUDF value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public MultiArrayUDF read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - MultiArrayUDF instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of MultiArrayUDF given an JSON string - * - * @param jsonString JSON string - * @return An instance of MultiArrayUDF - * @throws IOException if the JSON string is invalid with respect to MultiArrayUDF - */ + /** + * Create an instance of MultiArrayUDF given an JSON string + * + * @param jsonString JSON string + * @return An instance of MultiArrayUDF + * @throws IOException if the JSON string is invalid with respect to MultiArrayUDF + */ public static MultiArrayUDF fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MultiArrayUDF.class); } - /** - * Convert an instance of MultiArrayUDF to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MultiArrayUDF 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/model/NamespaceActions.java b/src/main/java/io/tiledb/cloud/rest_api/model/NamespaceActions.java index 45f9906..91bc16d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NamespaceActions.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NamespaceActions.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -88,5 +89,10 @@ public NamespaceActions read(final JsonReader jsonReader) throws IOException { return NamespaceActions.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NamespaceActions.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/NonEmptyDomain.java b/src/main/java/io/tiledb/cloud/rest_api/model/NonEmptyDomain.java index 7cb92d4..1d04add 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NonEmptyDomain.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NonEmptyDomain.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.DomainArray; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * object representing a non-empty domain */ -@ApiModel(description = "object representing a non-empty domain") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NonEmptyDomain { public static final String SERIALIZED_NAME_NON_EMPTY_DOMAIN = "nonEmptyDomain"; @SerializedName(SERIALIZED_NAME_NON_EMPTY_DOMAIN) @@ -52,89 +60,46 @@ public class NonEmptyDomain { @SerializedName(SERIALIZED_NAME_IS_EMPTY) private Boolean isEmpty; - public NonEmptyDomain() { + public NonEmptyDomain() { } public NonEmptyDomain nonEmptyDomain(DomainArray nonEmptyDomain) { - this.nonEmptyDomain = nonEmptyDomain; return this; } - /** + /** * Get nonEmptyDomain * @return nonEmptyDomain - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public DomainArray getNonEmptyDomain() { return nonEmptyDomain; } - public void setNonEmptyDomain(DomainArray nonEmptyDomain) { this.nonEmptyDomain = nonEmptyDomain; } public NonEmptyDomain isEmpty(Boolean isEmpty) { - this.isEmpty = isEmpty; return this; } - /** + /** * Is non-empty domain really empty? * @return isEmpty - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "false", required = true, value = "Is non-empty domain really empty?") - public Boolean getIsEmpty() { return isEmpty; } - public void setIsEmpty(Boolean isEmpty) { this.isEmpty = isEmpty; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public NonEmptyDomain putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -147,13 +112,12 @@ public boolean equals(Object o) { } NonEmptyDomain nonEmptyDomain = (NonEmptyDomain) o; return Objects.equals(this.nonEmptyDomain, nonEmptyDomain.nonEmptyDomain) && - Objects.equals(this.isEmpty, nonEmptyDomain.isEmpty)&& - Objects.equals(this.additionalProperties, nonEmptyDomain.additionalProperties); + Objects.equals(this.isEmpty, nonEmptyDomain.isEmpty); } @Override public int hashCode() { - return Objects.hash(nonEmptyDomain, isEmpty, additionalProperties); + return Objects.hash(nonEmptyDomain, isEmpty); } @Override @@ -162,7 +126,6 @@ public String toString() { sb.append("class NonEmptyDomain {\n"); sb.append(" nonEmptyDomain: ").append(toIndentedString(nonEmptyDomain)).append("\n"); sb.append(" isEmpty: ").append(toIndentedString(isEmpty)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -194,31 +157,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("isEmpty"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NonEmptyDomain - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NonEmptyDomain.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 NonEmptyDomain + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NonEmptyDomain.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NonEmptyDomain is not found in the empty JSON string", NonEmptyDomain.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NonEmptyDomain.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NonEmptyDomain` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NonEmptyDomain.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - // validate the optional field `nonEmptyDomain` - if (jsonObj.getAsJsonObject("nonEmptyDomain") != null) { - DomainArray.validateJsonObject(jsonObj.getAsJsonObject("nonEmptyDomain")); - } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `nonEmptyDomain` + DomainArray.validateJsonElement(jsonObj.get("nonEmptyDomain")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -236,71 +204,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NonEmptyDomain value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public NonEmptyDomain read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - NonEmptyDomain instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NonEmptyDomain given an JSON string - * - * @param jsonString JSON string - * @return An instance of NonEmptyDomain - * @throws IOException if the JSON string is invalid with respect to NonEmptyDomain - */ + /** + * Create an instance of NonEmptyDomain given an JSON string + * + * @param jsonString JSON string + * @return An instance of NonEmptyDomain + * @throws IOException if the JSON string is invalid with respect to NonEmptyDomain + */ public static NonEmptyDomain fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NonEmptyDomain.class); } - /** - * Convert an instance of NonEmptyDomain to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NonEmptyDomain 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/model/NotebookCopied.java b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookCopied.java index 239e3c4..5f89721 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NotebookCopied.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookCopied.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Copied notebook uri and information */ -@ApiModel(description = "Copied notebook uri and information") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotebookCopied { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) @@ -60,135 +67,84 @@ public class NotebookCopied { @SerializedName(SERIALIZED_NAME_ID) private String id; - public NotebookCopied() { + public NotebookCopied() { } public NotebookCopied outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB Notebook * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB Notebook") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public NotebookCopied name(String name) { - this.name = name; return this; } - /** + /** * name of the notebook created * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of the notebook created") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public NotebookCopied namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace copied to * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "namespace copied to") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public NotebookCopied id(String id) { - this.id = id; return this; } - /** + /** * unique ID of the copied notebook * @return id - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "unique ID of the copied notebook") - public String getId() { return id; } - public void setId(String id) { this.id = id; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public NotebookCopied putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +159,12 @@ public boolean equals(Object o) { return Objects.equals(this.outputUri, notebookCopied.outputUri) && Objects.equals(this.name, notebookCopied.name) && Objects.equals(this.namespace, notebookCopied.namespace) && - Objects.equals(this.id, notebookCopied.id)&& - Objects.equals(this.additionalProperties, notebookCopied.additionalProperties); + Objects.equals(this.id, notebookCopied.id); } @Override public int hashCode() { - return Objects.hash(outputUri, name, namespace, id, additionalProperties); + return Objects.hash(outputUri, name, namespace, id); } @Override @@ -220,7 +175,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -253,37 +207,44 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NotebookCopied - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NotebookCopied.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 NotebookCopied + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotebookCopied.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NotebookCopied is not found in the empty JSON string", NotebookCopied.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotebookCopied.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotebookCopied` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NotebookCopied.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + 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())); } } @@ -303,71 +264,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NotebookCopied value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public NotebookCopied read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - NotebookCopied instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NotebookCopied given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotebookCopied - * @throws IOException if the JSON string is invalid with respect to NotebookCopied - */ + /** + * Create an instance of NotebookCopied given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotebookCopied + * @throws IOException if the JSON string is invalid with respect to NotebookCopied + */ public static NotebookCopied fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotebookCopied.class); } - /** - * Convert an instance of NotebookCopied to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotebookCopied 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/model/NotebookCopy.java b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookCopy.java index 193426b..b62354d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NotebookCopy.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookCopy.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Output information required to copy a notebook */ -@ApiModel(description = "Output information required to copy a notebook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotebookCopy { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) @@ -56,112 +63,65 @@ public class NotebookCopy { @SerializedName(SERIALIZED_NAME_NAMESPACE) private String namespace; - public NotebookCopy() { + public NotebookCopy() { } public NotebookCopy outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB File * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB File") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public NotebookCopy name(String name) { - this.name = name; return this; } - /** + /** * name to set for registered notebook * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name to set for registered notebook") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public NotebookCopy namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace to copy to * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "namespace to copy to") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public NotebookCopy putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { NotebookCopy notebookCopy = (NotebookCopy) o; return Objects.equals(this.outputUri, notebookCopy.outputUri) && Objects.equals(this.name, notebookCopy.name) && - Objects.equals(this.namespace, notebookCopy.namespace)&& - Objects.equals(this.additionalProperties, notebookCopy.additionalProperties); + Objects.equals(this.namespace, notebookCopy.namespace); } @Override public int hashCode() { - return Objects.hash(outputUri, name, namespace, additionalProperties); + return Objects.hash(outputUri, name, namespace); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NotebookCopy - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NotebookCopy.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 NotebookCopy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotebookCopy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NotebookCopy is not found in the empty JSON string", NotebookCopy.openapiRequiredFields.toString())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotebookCopy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotebookCopy` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NotebookCopy value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public NotebookCopy read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - NotebookCopy instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NotebookCopy given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotebookCopy - * @throws IOException if the JSON string is invalid with respect to NotebookCopy - */ + /** + * Create an instance of NotebookCopy given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotebookCopy + * @throws IOException if the JSON string is invalid with respect to NotebookCopy + */ public static NotebookCopy fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotebookCopy.class); } - /** - * Convert an instance of NotebookCopy to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotebookCopy 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/model/NotebookFavorite.java b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookFavorite.java index d5c32a2..8dcad66 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NotebookFavorite.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookFavorite.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * A user-favorite notebook item */ -@ApiModel(description = "A user-favorite notebook item") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotebookFavorite { public static final String SERIALIZED_NAME_NOTEBOOK_UUID = "notebook_uuid"; @SerializedName(SERIALIZED_NAME_NOTEBOOK_UUID) @@ -56,112 +63,65 @@ public class NotebookFavorite { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public NotebookFavorite() { + public NotebookFavorite() { } public NotebookFavorite notebookUuid(String notebookUuid) { - this.notebookUuid = notebookUuid; return this; } - /** + /** * unique UUID of the notebook * @return notebookUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "unique UUID of the notebook") - public String getNotebookUuid() { return notebookUuid; } - public void setNotebookUuid(String notebookUuid) { this.notebookUuid = notebookUuid; } public NotebookFavorite namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * the namespace of the notebook * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the namespace of the notebook") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public NotebookFavorite name(String name) { - this.name = name; return this; } - /** + /** * the name of the notebook * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the notebook") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public NotebookFavorite putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { NotebookFavorite notebookFavorite = (NotebookFavorite) o; return Objects.equals(this.notebookUuid, notebookFavorite.notebookUuid) && Objects.equals(this.namespace, notebookFavorite.namespace) && - Objects.equals(this.name, notebookFavorite.name)&& - Objects.equals(this.additionalProperties, notebookFavorite.additionalProperties); + Objects.equals(this.name, notebookFavorite.name); } @Override public int hashCode() { - return Objects.hash(notebookUuid, namespace, name, additionalProperties); + return Objects.hash(notebookUuid, namespace, name); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" notebookUuid: ").append(toIndentedString(notebookUuid)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NotebookFavorite - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NotebookFavorite.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 NotebookFavorite + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotebookFavorite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NotebookFavorite is not found in the empty JSON string", NotebookFavorite.openapiRequiredFields.toString())); } } - if (jsonObj.get("notebook_uuid") != null && !jsonObj.get("notebook_uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotebookFavorite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotebookFavorite` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("notebook_uuid") != null && !jsonObj.get("notebook_uuid").isJsonNull()) && !jsonObj.get("notebook_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `notebook_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notebook_uuid").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NotebookFavorite value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public NotebookFavorite read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - NotebookFavorite instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NotebookFavorite given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotebookFavorite - * @throws IOException if the JSON string is invalid with respect to NotebookFavorite - */ + /** + * Create an instance of NotebookFavorite given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotebookFavorite + * @throws IOException if the JSON string is invalid with respect to NotebookFavorite + */ public static NotebookFavorite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotebookFavorite.class); } - /** - * Convert an instance of NotebookFavorite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotebookFavorite 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/model/NotebookFavoritesData.java b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesData.java index 119e0c7..97da8f7 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesData.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Object including notebook favorites and pagination metadata */ -@ApiModel(description = "Object including notebook favorites and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotebookFavoritesData { public static final String SERIALIZED_NAME_NOTEBOOKS = "notebooks"; @SerializedName(SERIALIZED_NAME_NOTEBOOKS) - private List notebooks = null; + private List notebooks = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public NotebookFavoritesData() { + public NotebookFavoritesData() { } public NotebookFavoritesData notebooks(List notebooks) { - this.notebooks = notebooks; return this; } @@ -72,80 +79,38 @@ public NotebookFavoritesData addNotebooksItem(ArrayInfo notebooksItem) { return this; } - /** + /** * List of notebook infos * @return notebooks - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of notebook infos") - public List getNotebooks() { return notebooks; } - public void setNotebooks(List notebooks) { this.notebooks = notebooks; } public NotebookFavoritesData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public NotebookFavoritesData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } NotebookFavoritesData notebookFavoritesData = (NotebookFavoritesData) o; return Objects.equals(this.notebooks, notebookFavoritesData.notebooks) && - Objects.equals(this.paginationMetadata, notebookFavoritesData.paginationMetadata)&& - Objects.equals(this.additionalProperties, notebookFavoritesData.additionalProperties); + Objects.equals(this.paginationMetadata, notebookFavoritesData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(notebooks, paginationMetadata, additionalProperties); + return Objects.hash(notebooks, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class NotebookFavoritesData {\n"); sb.append(" notebooks: ").append(toIndentedString(notebooks)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NotebookFavoritesData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NotebookFavoritesData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 NotebookFavoritesData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotebookFavoritesData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NotebookFavoritesData is not found in the empty JSON string", NotebookFavoritesData.openapiRequiredFields.toString())); } } - JsonArray jsonArraynotebooks = jsonObj.getAsJsonArray("notebooks"); - if (jsonArraynotebooks != null) { - // ensure the json data is an array - if (!jsonObj.get("notebooks").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `notebooks` to be an array in the JSON string but got `%s`", jsonObj.get("notebooks").toString())); - } - // validate the optional field `notebooks` (array) - for (int i = 0; i < jsonArraynotebooks.size(); i++) { - ArrayInfo.validateJsonObject(jsonArraynotebooks.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotebookFavoritesData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotebookFavoritesData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("notebooks") != null && !jsonObj.get("notebooks").isJsonNull()) { + JsonArray jsonArraynotebooks = jsonObj.getAsJsonArray("notebooks"); + if (jsonArraynotebooks != null) { + // ensure the json data is an array + if (!jsonObj.get("notebooks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notebooks` to be an array in the JSON string but got `%s`", jsonObj.get("notebooks").toString())); + } + + // validate the optional field `notebooks` (array) + for (int i = 0; i < jsonArraynotebooks.size(); i++) { + ArrayInfo.validateJsonElement(jsonArraynotebooks.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -250,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NotebookFavoritesData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public NotebookFavoritesData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - NotebookFavoritesData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NotebookFavoritesData given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotebookFavoritesData - * @throws IOException if the JSON string is invalid with respect to NotebookFavoritesData - */ + /** + * Create an instance of NotebookFavoritesData given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotebookFavoritesData + * @throws IOException if the JSON string is invalid with respect to NotebookFavoritesData + */ public static NotebookFavoritesData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotebookFavoritesData.class); } - /** - * Convert an instance of NotebookFavoritesData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotebookFavoritesData 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/model/NotebookStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookStatus.java index b34b1c0..9e12299 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/NotebookStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/NotebookStatus.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.PodStatus; import java.io.IOException; - +import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * Status details of a notebook server */ -@ApiModel(description = "Status details of a notebook server") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotebookStatus { public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -94,319 +101,236 @@ public class NotebookStatus { @SerializedName(SERIALIZED_NAME_POD_STATUS) private PodStatus podStatus; - public NotebookStatus() { + public NotebookStatus() { } public NotebookStatus namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace of notebook * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "namespace of notebook") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public NotebookStatus uptime(Integer uptime) { - this.uptime = uptime; return this; } - /** + /** * duration notebook has been running in seconds * @return uptime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "120", value = "duration notebook has been running in seconds") - public Integer getUptime() { return uptime; } - public void setUptime(Integer uptime) { this.uptime = uptime; } public NotebookStatus cpuUsage(Integer cpuUsage) { - this.cpuUsage = cpuUsage; return this; } - /** + /** * current cpu usage in millicpu * @return cpuUsage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "4000", value = "current cpu usage in millicpu") - public Integer getCpuUsage() { return cpuUsage; } - public void setCpuUsage(Integer cpuUsage) { this.cpuUsage = cpuUsage; } public NotebookStatus gpuUsage(Integer gpuUsage) { - this.gpuUsage = gpuUsage; return this; } - /** + /** * gpu usage in milligpu * @return gpuUsage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "4000", value = "gpu usage in milligpu") - public Integer getGpuUsage() { return gpuUsage; } - public void setGpuUsage(Integer gpuUsage) { this.gpuUsage = gpuUsage; } public NotebookStatus memoryUsage(Integer memoryUsage) { - this.memoryUsage = memoryUsage; return this; } - /** + /** * memory usage in bytes * @return memoryUsage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "memory usage in bytes") - public Integer getMemoryUsage() { return memoryUsage; } - public void setMemoryUsage(Integer memoryUsage) { this.memoryUsage = memoryUsage; } public NotebookStatus gpuLimit(Integer gpuLimit) { - this.gpuLimit = gpuLimit; return this; } - /** + /** * gpu limit in milligpu * @return gpuLimit - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "gpu limit in milligpu") - public Integer getGpuLimit() { return gpuLimit; } - public void setGpuLimit(Integer gpuLimit) { this.gpuLimit = gpuLimit; } public NotebookStatus memoryLimit(Integer memoryLimit) { - this.memoryLimit = memoryLimit; return this; } - /** + /** * memory allocated to notebook server in bytes * @return memoryLimit - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "memory allocated to notebook server in bytes") - public Integer getMemoryLimit() { return memoryLimit; } - public void setMemoryLimit(Integer memoryLimit) { this.memoryLimit = memoryLimit; } public NotebookStatus storageUsage(Integer storageUsage) { - this.storageUsage = storageUsage; return this; } - /** + /** * storage usage in bytes * @return storageUsage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "storage usage in bytes") - public Integer getStorageUsage() { return storageUsage; } - public void setStorageUsage(Integer storageUsage) { this.storageUsage = storageUsage; } public NotebookStatus storageLimit(Integer storageLimit) { - this.storageLimit = storageLimit; return this; } - /** + /** * storage allocated to notebook server in bytes * @return storageLimit - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1073741824", value = "storage allocated to notebook server in bytes") - public Integer getStorageLimit() { return storageLimit; } - public void setStorageLimit(Integer storageLimit) { this.storageLimit = storageLimit; } public NotebookStatus cpuCount(Integer cpuCount) { - this.cpuCount = cpuCount; return this; } - /** + /** * millicpu allocated to notebook server * @return cpuCount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "4000", value = "millicpu allocated to notebook server") - public Integer getCpuCount() { return cpuCount; } - public void setCpuCount(Integer cpuCount) { this.cpuCount = cpuCount; } public NotebookStatus cost(Double cost) { - this.cost = cost; return this; } - /** + /** * cost in USD for the current notebook session * @return cost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "0.27", value = "cost in USD for the current notebook session") - public Double getCost() { return cost; } - public void setCost(Double cost) { this.cost = cost; } public NotebookStatus podStatus(PodStatus podStatus) { - this.podStatus = podStatus; return this; } - /** + /** * Get podStatus * @return podStatus - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PodStatus getPodStatus() { return podStatus; } - public void setPodStatus(PodStatus podStatus) { this.podStatus = podStatus; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public NotebookStatus putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -429,8 +353,7 @@ public boolean equals(Object o) { Objects.equals(this.storageLimit, notebookStatus.storageLimit) && Objects.equals(this.cpuCount, notebookStatus.cpuCount) && Objects.equals(this.cost, notebookStatus.cost) && - Objects.equals(this.podStatus, notebookStatus.podStatus)&& - Objects.equals(this.additionalProperties, notebookStatus.additionalProperties); + Objects.equals(this.podStatus, notebookStatus.podStatus); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -439,7 +362,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(namespace, uptime, cpuUsage, gpuUsage, memoryUsage, gpuLimit, memoryLimit, storageUsage, storageLimit, cpuCount, cost, podStatus, additionalProperties); + return Objects.hash(namespace, uptime, cpuUsage, gpuUsage, memoryUsage, gpuLimit, memoryLimit, storageUsage, storageLimit, cpuCount, cost, podStatus); } private static int hashCodeNullable(JsonNullable a) { @@ -465,7 +388,6 @@ public String toString() { sb.append(" cpuCount: ").append(toIndentedString(cpuCount)).append("\n"); sb.append(" cost: ").append(toIndentedString(cost)).append("\n"); sb.append(" podStatus: ").append(toIndentedString(podStatus)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -505,23 +427,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to NotebookStatus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (NotebookStatus.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 NotebookStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NotebookStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in NotebookStatus is not found in the empty JSON string", NotebookStatus.openapiRequiredFields.toString())); } } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NotebookStatus.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotebookStatus` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } + // validate the optional field `pod_status` + if (jsonObj.get("pod_status") != null && !jsonObj.get("pod_status").isJsonNull()) { + PodStatus.validateJsonElement(jsonObj.get("pod_status")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -539,71 +472,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NotebookStatus value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public NotebookStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - NotebookStatus instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of NotebookStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotebookStatus - * @throws IOException if the JSON string is invalid with respect to NotebookStatus - */ + /** + * Create an instance of NotebookStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotebookStatus + * @throws IOException if the JSON string is invalid with respect to NotebookStatus + */ public static NotebookStatus fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotebookStatus.class); } - /** - * Convert an instance of NotebookStatus to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotebookStatus 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/model/Organization.java b/src/main/java/io/tiledb/cloud/rest_api/model/Organization.java index ff0f0c8..ab12201 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Organization.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Organization.java @@ -14,33 +14,43 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AssetLocations; +import io.tiledb.cloud.rest_api.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; +import io.tiledb.cloud.rest_api.model.OrganizationUser; import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -48,8 +58,7 @@ /** * Organization */ -@ApiModel(description = "Organization") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Organization { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -81,11 +90,11 @@ public class Organization { public static final String SERIALIZED_NAME_USERS = "users"; @SerializedName(SERIALIZED_NAME_USERS) - private List users = null; + private List users = new ArrayList<>(); public static final String SERIALIZED_NAME_ALLOWED_ACTIONS = "allowed_actions"; @SerializedName(SERIALIZED_NAME_ALLOWED_ACTIONS) - private List allowedActions = null; + private List allowedActions = new ArrayList<>(); public static final String SERIALIZED_NAME_NUM_OF_ARRAYS = "num_of_arrays"; @SerializedName(SERIALIZED_NAME_NUM_OF_ARRAYS) @@ -93,7 +102,7 @@ public class Organization { public static final String SERIALIZED_NAME_ENABLED_FEATURES = "enabled_features"; @SerializedName(SERIALIZED_NAME_ENABLED_FEATURES) - private List enabledFeatures = null; + private List enabledFeatures = new ArrayList<>(); public static final String SERIALIZED_NAME_UNPAID_SUBSCRIPTION = "unpaid_subscription"; @SerializedName(SERIALIZED_NAME_UNPAID_SUBSCRIPTION) @@ -119,10 +128,9 @@ public class Organization { @SerializedName(SERIALIZED_NAME_ASSUME_ROLE_ARN) private String assumeRoleArn; - public Organization() { + public Organization() { } - public Organization( List enabledFeatures, Boolean unpaidSubscription, @@ -135,168 +143,139 @@ public Organization( } public Organization id(String id) { - this.id = id; return this; } - /** + /** * unique ID of organization * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of organization") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public Organization role(OrganizationRoles role) { - this.role = role; return this; } - /** + /** * Get role * @return role - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public OrganizationRoles getRole() { return role; } - public void setRole(OrganizationRoles role) { this.role = role; } public Organization name(String name) { - this.name = name; return this; } - /** + /** * organization name must be unique * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "organization name must be unique") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public Organization createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } - /** + /** * Datetime organization was created in UTC * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime organization was created in UTC") - public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } public Organization updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; return this; } - /** + /** * Datetime organization was updated in UTC * @return updatedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Datetime organization was updated in UTC") - public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; } public Organization logo(String logo) { - this.logo = logo; return this; } - /** + /** * Organization logo * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Organization logo") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public Organization description(String description) { - this.description = description; return this; } - /** + /** * Organization description * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Organization description") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public Organization users(List users) { - this.users = users; return this; } @@ -309,25 +288,21 @@ public Organization addUsersItem(OrganizationUser usersItem) { return this; } - /** + /** * Get users * @return users - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getUsers() { return users; } - public void setUsers(List users) { this.users = users; } public Organization allowedActions(List allowedActions) { - this.allowedActions = allowedActions; return this; } @@ -340,214 +315,147 @@ public Organization addAllowedActionsItem(NamespaceActions allowedActionsItem) { return this; } - /** + /** * list of actions user is allowed to do on this organization * @return allowedActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of actions user is allowed to do on this organization") - public List getAllowedActions() { return allowedActions; } - public void setAllowedActions(List allowedActions) { this.allowedActions = allowedActions; } public Organization numOfArrays(BigDecimal numOfArrays) { - this.numOfArrays = numOfArrays; return this; } - /** + /** * number of registered arrays for this organization * @return numOfArrays - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "number of registered arrays for this organization") - public BigDecimal getNumOfArrays() { return numOfArrays; } - public void setNumOfArrays(BigDecimal numOfArrays) { this.numOfArrays = numOfArrays; } - /** + /** * List of extra/optional/beta features to enable for namespace * @return enabledFeatures - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of extra/optional/beta features to enable for namespace") - public List getEnabledFeatures() { return enabledFeatures; } - - /** + /** * A notice that the user has an unpaid subscription * @return unpaidSubscription - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A notice that the user has an unpaid subscription") - public Boolean getUnpaidSubscription() { return unpaidSubscription; } - public Organization defaultS3Path(String defaultS3Path) { - this.defaultS3Path = defaultS3Path; return this; } - /** + /** * 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. * @return defaultS3Path - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "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. ") - public String getDefaultS3Path() { return defaultS3Path; } - public void setDefaultS3Path(String defaultS3Path) { this.defaultS3Path = defaultS3Path; } public Organization defaultS3PathCredentialsName(String defaultS3PathCredentialsName) { - this.defaultS3PathCredentialsName = defaultS3PathCredentialsName; return this; } - /** + /** * The name of the credentials used to create and access files in the `default_s3_path`, if needed. * @return defaultS3PathCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the credentials used to create and access files in the `default_s3_path`, if needed. ") - public String getDefaultS3PathCredentialsName() { return defaultS3PathCredentialsName; } - public void setDefaultS3PathCredentialsName(String defaultS3PathCredentialsName) { this.defaultS3PathCredentialsName = defaultS3PathCredentialsName; } public Organization assetLocations(AssetLocations assetLocations) { - this.assetLocations = assetLocations; return this; } - /** + /** * Get assetLocations * @return assetLocations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetLocations getAssetLocations() { return assetLocations; } - public void setAssetLocations(AssetLocations assetLocations) { this.assetLocations = assetLocations; } - /** + /** * Denotes that the organization is able to apply pricing to arrays by means of Stripe Connect * @return stripeConnect - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "Denotes that the organization is able to apply pricing to arrays by means of Stripe Connect") - public Boolean getStripeConnect() { return stripeConnect; } - public Organization assumeRoleArn(String assumeRoleArn) { - this.assumeRoleArn = assumeRoleArn; return this; } - /** + /** * A AWS Role that will be first assumed before assuming the organization's AWS Role. Visible to owners and admins. * @return assumeRoleArn - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A AWS Role that will be first assumed before assuming the organization's AWS Role. Visible to owners and admins. ") - public String getAssumeRoleArn() { return assumeRoleArn; } - public void setAssumeRoleArn(String assumeRoleArn) { this.assumeRoleArn = assumeRoleArn; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Organization putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -575,8 +483,7 @@ public boolean equals(Object o) { Objects.equals(this.defaultS3PathCredentialsName, organization.defaultS3PathCredentialsName) && Objects.equals(this.assetLocations, organization.assetLocations) && Objects.equals(this.stripeConnect, organization.stripeConnect) && - Objects.equals(this.assumeRoleArn, organization.assumeRoleArn)&& - Objects.equals(this.additionalProperties, organization.additionalProperties); + Objects.equals(this.assumeRoleArn, organization.assumeRoleArn); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -585,7 +492,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, role, name, createdAt, updatedAt, logo, description, users, allowedActions, numOfArrays, enabledFeatures, unpaidSubscription, defaultS3Path, defaultS3PathCredentialsName, assetLocations, stripeConnect, assumeRoleArn, additionalProperties); + return Objects.hash(id, role, name, createdAt, updatedAt, logo, description, users, allowedActions, numOfArrays, enabledFeatures, unpaidSubscription, defaultS3Path, defaultS3PathCredentialsName, assetLocations, stripeConnect, assumeRoleArn); } private static int hashCodeNullable(JsonNullable a) { @@ -616,7 +523,6 @@ public String toString() { sb.append(" assetLocations: ").append(toIndentedString(assetLocations)).append("\n"); sb.append(" stripeConnect: ").append(toIndentedString(stripeConnect)).append("\n"); sb.append(" assumeRoleArn: ").append(toIndentedString(assumeRoleArn)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -662,70 +568,83 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Organization - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Organization.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Organization + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Organization.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Organization is not found in the empty JSON string", Organization.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Organization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Organization` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Organization.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + OrganizationRoles.validateJsonElement(jsonObj.get("role")); + } + 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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + 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())); } - JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); - if (jsonArrayusers != null) { - // ensure the json data is an array - if (!jsonObj.get("users").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + if (jsonObj.get("users") != null && !jsonObj.get("users").isJsonNull()) { + JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); + if (jsonArrayusers != null) { + // ensure the json data is an array + if (!jsonObj.get("users").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + } + + // validate the optional field `users` (array) + for (int i = 0; i < jsonArrayusers.size(); i++) { + OrganizationUser.validateJsonElement(jsonArrayusers.get(i)); + }; } - - // validate the optional field `users` (array) - for (int i = 0; i < jsonArrayusers.size(); i++) { - OrganizationUser.validateJsonObject(jsonArrayusers.get(i).getAsJsonObject()); - }; } - // ensure the json data is an array - if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonNull() && !jsonObj.get("allowed_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `allowed_actions` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_actions").toString())); } - // ensure the json data is an array - if (jsonObj.get("enabled_features") != null && !jsonObj.get("enabled_features").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("enabled_features") != null && !jsonObj.get("enabled_features").isJsonNull() && !jsonObj.get("enabled_features").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `enabled_features` to be an array in the JSON string but got `%s`", jsonObj.get("enabled_features").toString())); } - if (jsonObj.get("default_s3_path") != null && !jsonObj.get("default_s3_path").isJsonPrimitive()) { + if ((jsonObj.get("default_s3_path") != null && !jsonObj.get("default_s3_path").isJsonNull()) && !jsonObj.get("default_s3_path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `default_s3_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_s3_path").toString())); } - if (jsonObj.get("default_s3_path_credentials_name") != null && !jsonObj.get("default_s3_path_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("default_s3_path_credentials_name") != null && !jsonObj.get("default_s3_path_credentials_name").isJsonNull()) && !jsonObj.get("default_s3_path_credentials_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `default_s3_path_credentials_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_s3_path_credentials_name").toString())); } // validate the optional field `asset_locations` - if (jsonObj.getAsJsonObject("asset_locations") != null) { - AssetLocations.validateJsonObject(jsonObj.getAsJsonObject("asset_locations")); + if (jsonObj.get("asset_locations") != null && !jsonObj.get("asset_locations").isJsonNull()) { + AssetLocations.validateJsonElement(jsonObj.get("asset_locations")); } - if (jsonObj.get("assume_role_arn") != null && !jsonObj.get("assume_role_arn").isJsonPrimitive()) { + if ((jsonObj.get("assume_role_arn") != null && !jsonObj.get("assume_role_arn").isJsonNull()) && !jsonObj.get("assume_role_arn").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `assume_role_arn` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assume_role_arn").toString())); } } @@ -745,71 +664,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Organization value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Organization read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Organization instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Organization given an JSON string - * - * @param jsonString JSON string - * @return An instance of Organization - * @throws IOException if the JSON string is invalid with respect to Organization - */ + /** + * Create an instance of Organization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Organization + * @throws IOException if the JSON string is invalid with respect to Organization + */ public static Organization fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Organization.class); } - /** - * Convert an instance of Organization to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Organization 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/model/OrganizationRoles.java b/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationRoles.java index 43c1984..6a712c4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationRoles.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationRoles.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -74,5 +75,10 @@ public OrganizationRoles read(final JsonReader jsonReader) throws IOException { return OrganizationRoles.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OrganizationRoles.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUpdate.java b/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUpdate.java index 7f07fd2..5b1f3c0 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUpdate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUpdate.java @@ -14,28 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AssetLocations; import java.io.IOException; - +import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +51,7 @@ /** * OrganizationUpdate */ -@ApiModel(description = "OrganizationUpdate") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class OrganizationUpdate { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -70,181 +77,122 @@ public class OrganizationUpdate { @SerializedName(SERIALIZED_NAME_ASSET_LOCATIONS) private AssetLocations assetLocations; - public OrganizationUpdate() { + public OrganizationUpdate() { } public OrganizationUpdate name(String name) { - this.name = name; return this; } - /** + /** * organization name must be unique * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "organization name must be unique") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public OrganizationUpdate logo(String logo) { - this.logo = logo; return this; } - /** + /** * Organization logo * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Organization logo") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public OrganizationUpdate description(String description) { - this.description = description; return this; } - /** + /** * Organization description * @return description - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Organization description") - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } public OrganizationUpdate defaultS3Path(String defaultS3Path) { - this.defaultS3Path = defaultS3Path; return this; } - /** + /** * 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. * @return defaultS3Path - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "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. ") - public String getDefaultS3Path() { return defaultS3Path; } - public void setDefaultS3Path(String defaultS3Path) { this.defaultS3Path = defaultS3Path; } public OrganizationUpdate defaultS3PathCredentialsName(String defaultS3PathCredentialsName) { - this.defaultS3PathCredentialsName = defaultS3PathCredentialsName; return this; } - /** + /** * The name of the credentials used to create and access files in the `default_s3_path`, if needed. * @return defaultS3PathCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the credentials used to create and access files in the `default_s3_path`, if needed. ") - public String getDefaultS3PathCredentialsName() { return defaultS3PathCredentialsName; } - public void setDefaultS3PathCredentialsName(String defaultS3PathCredentialsName) { this.defaultS3PathCredentialsName = defaultS3PathCredentialsName; } public OrganizationUpdate assetLocations(AssetLocations assetLocations) { - this.assetLocations = assetLocations; return this; } - /** + /** * Get assetLocations * @return assetLocations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetLocations getAssetLocations() { return assetLocations; } - public void setAssetLocations(AssetLocations assetLocations) { this.assetLocations = assetLocations; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public OrganizationUpdate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -261,8 +209,7 @@ public boolean equals(Object o) { Objects.equals(this.description, organizationUpdate.description) && Objects.equals(this.defaultS3Path, organizationUpdate.defaultS3Path) && Objects.equals(this.defaultS3PathCredentialsName, organizationUpdate.defaultS3PathCredentialsName) && - Objects.equals(this.assetLocations, organizationUpdate.assetLocations)&& - Objects.equals(this.additionalProperties, organizationUpdate.additionalProperties); + Objects.equals(this.assetLocations, organizationUpdate.assetLocations); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -271,7 +218,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(name, logo, description, defaultS3Path, defaultS3PathCredentialsName, assetLocations, additionalProperties); + return Objects.hash(name, logo, description, defaultS3Path, defaultS3PathCredentialsName, assetLocations); } private static int hashCodeNullable(JsonNullable a) { @@ -291,7 +238,6 @@ public String toString() { sb.append(" defaultS3Path: ").append(toIndentedString(defaultS3Path)).append("\n"); sb.append(" defaultS3PathCredentialsName: ").append(toIndentedString(defaultS3PathCredentialsName)).append("\n"); sb.append(" assetLocations: ").append(toIndentedString(assetLocations)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -325,38 +271,45 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to OrganizationUpdate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (OrganizationUpdate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 OrganizationUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationUpdate is not found in the empty JSON string", OrganizationUpdate.openapiRequiredFields.toString())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationUpdate` 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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + 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("default_s3_path") != null && !jsonObj.get("default_s3_path").isJsonPrimitive()) { + if ((jsonObj.get("default_s3_path") != null && !jsonObj.get("default_s3_path").isJsonNull()) && !jsonObj.get("default_s3_path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `default_s3_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_s3_path").toString())); } - if (jsonObj.get("default_s3_path_credentials_name") != null && !jsonObj.get("default_s3_path_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("default_s3_path_credentials_name") != null && !jsonObj.get("default_s3_path_credentials_name").isJsonNull()) && !jsonObj.get("default_s3_path_credentials_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `default_s3_path_credentials_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_s3_path_credentials_name").toString())); } // validate the optional field `asset_locations` - if (jsonObj.getAsJsonObject("asset_locations") != null) { - AssetLocations.validateJsonObject(jsonObj.getAsJsonObject("asset_locations")); + if (jsonObj.get("asset_locations") != null && !jsonObj.get("asset_locations").isJsonNull()) { + AssetLocations.validateJsonElement(jsonObj.get("asset_locations")); } } @@ -375,71 +328,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, OrganizationUpdate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public OrganizationUpdate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - OrganizationUpdate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of OrganizationUpdate given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationUpdate - * @throws IOException if the JSON string is invalid with respect to OrganizationUpdate - */ + /** + * Create an instance of OrganizationUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationUpdate + * @throws IOException if the JSON string is invalid with respect to OrganizationUpdate + */ public static OrganizationUpdate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, OrganizationUpdate.class); } - /** - * Convert an instance of OrganizationUpdate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of OrganizationUpdate 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/model/OrganizationUser.java b/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUser.java index 2206f37..82ea31d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUser.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/OrganizationUser.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +53,7 @@ /** * user in an organization */ -@ApiModel(description = "user in an organization") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class OrganizationUser { public static final String SERIALIZED_NAME_USER_ID = "user_id"; @SerializedName(SERIALIZED_NAME_USER_ID) @@ -76,174 +85,145 @@ public class OrganizationUser { public static final String SERIALIZED_NAME_ALLOWED_ACTIONS = "allowed_actions"; @SerializedName(SERIALIZED_NAME_ALLOWED_ACTIONS) - private List allowedActions = null; + private List allowedActions = new ArrayList<>(); - public OrganizationUser() { + public OrganizationUser() { } public OrganizationUser userId(String userId) { - this.userId = userId; return this; } - /** + /** * unique ID of user * @return userId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of user") - public String getUserId() { return userId; } - public void setUserId(String userId) { this.userId = userId; } public OrganizationUser organizationId(String organizationId) { - this.organizationId = organizationId; return this; } - /** + /** * unique ID of organization * @return organizationId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of organization") - public String getOrganizationId() { return organizationId; } - public void setOrganizationId(String organizationId) { this.organizationId = organizationId; } public OrganizationUser username(String username) { - this.username = username; return this; } - /** + /** * username for user * @return username - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "username", value = "username for user") - public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } public OrganizationUser userFullName(String userFullName) { - this.userFullName = userFullName; return this; } - /** + /** * full name of the user; available to organization admins * @return userFullName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "Alice Hanna", value = "full name of the user; available to organization admins") - public String getUserFullName() { return userFullName; } - public void setUserFullName(String userFullName) { this.userFullName = userFullName; } public OrganizationUser userEmail(String userEmail) { - this.userEmail = userEmail; return this; } - /** + /** * email address of the user; available to organization admins * @return userEmail - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "alice@example.com", value = "email address of the user; available to organization admins") - public String getUserEmail() { return userEmail; } - public void setUserEmail(String userEmail) { this.userEmail = userEmail; } public OrganizationUser organizationName(String organizationName) { - this.organizationName = organizationName; return this; } - /** + /** * name of organization * @return organizationName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "MyOrganization", value = "name of organization") - public String getOrganizationName() { return organizationName; } - public void setOrganizationName(String organizationName) { this.organizationName = organizationName; } public OrganizationUser role(OrganizationRoles role) { - this.role = role; return this; } - /** + /** * Get role * @return role - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public OrganizationRoles getRole() { return role; } - public void setRole(OrganizationRoles role) { this.role = role; } public OrganizationUser allowedActions(List allowedActions) { - this.allowedActions = allowedActions; return this; } @@ -256,57 +236,19 @@ public OrganizationUser addAllowedActionsItem(NamespaceActions allowedActionsIte return this; } - /** + /** * list of actions user is allowed to do on this organization * @return allowedActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of actions user is allowed to do on this organization") - public List getAllowedActions() { return allowedActions; } - public void setAllowedActions(List allowedActions) { this.allowedActions = allowedActions; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public OrganizationUser putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -325,13 +267,12 @@ public boolean equals(Object o) { Objects.equals(this.userEmail, organizationUser.userEmail) && Objects.equals(this.organizationName, organizationUser.organizationName) && Objects.equals(this.role, organizationUser.role) && - Objects.equals(this.allowedActions, organizationUser.allowedActions)&& - Objects.equals(this.additionalProperties, organizationUser.additionalProperties); + Objects.equals(this.allowedActions, organizationUser.allowedActions); } @Override public int hashCode() { - return Objects.hash(userId, organizationId, username, userFullName, userEmail, organizationName, role, allowedActions, additionalProperties); + return Objects.hash(userId, organizationId, username, userFullName, userEmail, organizationName, role, allowedActions); } @Override @@ -346,7 +287,6 @@ public String toString() { sb.append(" organizationName: ").append(toIndentedString(organizationName)).append("\n"); sb.append(" role: ").append(toIndentedString(role)).append("\n"); sb.append(" allowedActions: ").append(toIndentedString(allowedActions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -382,40 +322,51 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to OrganizationUser - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (OrganizationUser.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 OrganizationUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationUser is not found in the empty JSON string", OrganizationUser.openapiRequiredFields.toString())); } } - if (jsonObj.get("user_id") != null && !jsonObj.get("user_id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrganizationUser.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrganizationUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("user_id") != null && !jsonObj.get("user_id").isJsonNull()) && !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("organization_id") != null && !jsonObj.get("organization_id").isJsonPrimitive()) { + if ((jsonObj.get("organization_id") != null && !jsonObj.get("organization_id").isJsonNull()) && !jsonObj.get("organization_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `organization_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_id").toString())); } - if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !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("user_full_name") != null && !jsonObj.get("user_full_name").isJsonPrimitive()) { + if ((jsonObj.get("user_full_name") != null && !jsonObj.get("user_full_name").isJsonNull()) && !jsonObj.get("user_full_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `user_full_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_full_name").toString())); } - if (jsonObj.get("user_email") != null && !jsonObj.get("user_email").isJsonPrimitive()) { + if ((jsonObj.get("user_email") != null && !jsonObj.get("user_email").isJsonNull()) && !jsonObj.get("user_email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `user_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_email").toString())); } - if (jsonObj.get("organization_name") != null && !jsonObj.get("organization_name").isJsonPrimitive()) { + if ((jsonObj.get("organization_name") != null && !jsonObj.get("organization_name").isJsonNull()) && !jsonObj.get("organization_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `organization_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_name").toString())); } - // ensure the json data is an array - if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonArray()) { + // validate the optional field `role` + if (jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) { + OrganizationRoles.validateJsonElement(jsonObj.get("role")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonNull() && !jsonObj.get("allowed_actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `allowed_actions` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_actions").toString())); } } @@ -435,71 +386,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, OrganizationUser value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public OrganizationUser read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - OrganizationUser instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of OrganizationUser given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrganizationUser - * @throws IOException if the JSON string is invalid with respect to OrganizationUser - */ + /** + * Create an instance of OrganizationUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationUser + * @throws IOException if the JSON string is invalid with respect to OrganizationUser + */ public static OrganizationUser fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, OrganizationUser.class); } - /** - * Convert an instance of OrganizationUser to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of OrganizationUser 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/model/PaginationMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/model/PaginationMetadata.java index 424b91d..56f9922 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PaginationMetadata.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PaginationMetadata.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,7 +50,7 @@ /** * PaginationMetadata */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class PaginationMetadata { public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @@ -59,135 +68,84 @@ public class PaginationMetadata { @SerializedName(SERIALIZED_NAME_TOTAL_ITEMS) private BigDecimal totalItems; - public PaginationMetadata() { + public PaginationMetadata() { } public PaginationMetadata page(BigDecimal page) { - this.page = page; return this; } - /** + /** * pagination offset. Use it to skip the first ((page - 1) * per_page) items * @return page - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1.0", value = "pagination offset. Use it to skip the first ((page - 1) * per_page) items") - public BigDecimal getPage() { return page; } - public void setPage(BigDecimal page) { this.page = page; } public PaginationMetadata perPage(BigDecimal perPage) { - this.perPage = perPage; return this; } - /** + /** * pagination limit (page size) * @return perPage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "10.0", value = "pagination limit (page size)") - public BigDecimal getPerPage() { return perPage; } - public void setPerPage(BigDecimal perPage) { this.perPage = perPage; } public PaginationMetadata totalPages(BigDecimal totalPages) { - this.totalPages = totalPages; return this; } - /** + /** * number of total pages with current limit * @return totalPages - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "14.0", value = "number of total pages with current limit") - public BigDecimal getTotalPages() { return totalPages; } - public void setTotalPages(BigDecimal totalPages) { this.totalPages = totalPages; } public PaginationMetadata totalItems(BigDecimal totalItems) { - this.totalItems = totalItems; return this; } - /** + /** * number of total available items * @return totalItems - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "138.0", value = "number of total available items") - public BigDecimal getTotalItems() { return totalItems; } - public void setTotalItems(BigDecimal totalItems) { this.totalItems = totalItems; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public PaginationMetadata putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -202,13 +160,12 @@ public boolean equals(Object 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)&& - Objects.equals(this.additionalProperties, paginationMetadata.additionalProperties); + Objects.equals(this.totalItems, paginationMetadata.totalItems); } @Override public int hashCode() { - return Objects.hash(page, perPage, totalPages, totalItems, additionalProperties); + return Objects.hash(page, perPage, totalPages, totalItems); } @Override @@ -219,7 +176,6 @@ public String toString() { 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -251,20 +207,27 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PaginationMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (PaginationMetadata.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -282,71 +245,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PaginationMetadata value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public PaginationMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - PaginationMetadata instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/PodStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/PodStatus.java index 33d0a89..66f7c27 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PodStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PodStatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public PodStatus read(final JsonReader jsonReader) throws IOException { return PodStatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PodStatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/Pricing.java b/src/main/java/io/tiledb/cloud/rest_api/model/Pricing.java index cbbdfce..df69a90 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Pricing.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Pricing.java @@ -14,26 +14,39 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.PricingAggregateUsage; +import io.tiledb.cloud.rest_api.model.PricingCurrency; +import io.tiledb.cloud.rest_api.model.PricingInterval; +import io.tiledb.cloud.rest_api.model.PricingType; +import io.tiledb.cloud.rest_api.model.PricingUnitLabel; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +54,7 @@ /** * Pricing created by converting an array to product */ -@ApiModel(description = "Pricing created by converting an array to product") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Pricing { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -96,342 +108,255 @@ public class Pricing { @SerializedName(SERIALIZED_NAME_ACTIVATED) private Boolean activated; - public Pricing() { + public Pricing() { } public Pricing id(String id) { - this.id = id; return this; } - /** + /** * Unique ID of plan as defined by Stripe * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "planID", value = "Unique ID of plan as defined by Stripe") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public Pricing arrayUuid(String arrayUuid) { - this.arrayUuid = arrayUuid; return this; } - /** + /** * Unique ID of registered array * @return arrayUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of registered array") - public String getArrayUuid() { return arrayUuid; } - public void setArrayUuid(String arrayUuid) { this.arrayUuid = arrayUuid; } public Pricing pricingName(String pricingName) { - this.pricingName = pricingName; return this; } - /** + /** * Name of pricing * @return pricingName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Name of pricing") - public String getPricingName() { return pricingName; } - public void setPricingName(String pricingName) { this.pricingName = pricingName; } public Pricing pricingType(PricingType pricingType) { - this.pricingType = pricingType; return this; } - /** + /** * Get pricingType * @return pricingType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PricingType getPricingType() { return pricingType; } - public void setPricingType(PricingType pricingType) { this.pricingType = pricingType; } public Pricing productName(String productName) { - this.productName = productName; return this; } - /** + /** * Name of product * @return productName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Name of product") - public String getProductName() { return productName; } - public void setProductName(String productName) { this.productName = productName; } public Pricing productStatementDescriptor(String productStatementDescriptor) { - this.productStatementDescriptor = productStatementDescriptor; return this; } - /** + /** * Extra information about a product which will appear on the credit card statement of the customer * @return productStatementDescriptor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Extra information about a product which will appear on the credit card statement of the customer") - public String getProductStatementDescriptor() { return productStatementDescriptor; } - public void setProductStatementDescriptor(String productStatementDescriptor) { this.productStatementDescriptor = productStatementDescriptor; } public Pricing productUnitLabel(PricingUnitLabel productUnitLabel) { - this.productUnitLabel = productUnitLabel; return this; } - /** + /** * Get productUnitLabel * @return productUnitLabel - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PricingUnitLabel getProductUnitLabel() { return productUnitLabel; } - public void setProductUnitLabel(PricingUnitLabel productUnitLabel) { this.productUnitLabel = productUnitLabel; } public Pricing currency(PricingCurrency currency) { - this.currency = currency; return this; } - /** + /** * Get currency * @return currency - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PricingCurrency getCurrency() { return currency; } - public void setCurrency(PricingCurrency currency) { this.currency = currency; } public Pricing aggregateUsage(PricingAggregateUsage aggregateUsage) { - this.aggregateUsage = aggregateUsage; return this; } - /** + /** * Get aggregateUsage * @return aggregateUsage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PricingAggregateUsage getAggregateUsage() { return aggregateUsage; } - public void setAggregateUsage(PricingAggregateUsage aggregateUsage) { this.aggregateUsage = aggregateUsage; } public Pricing interval(PricingInterval interval) { - this.interval = interval; return this; } - /** + /** * Get interval * @return interval - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PricingInterval getInterval() { return interval; } - public void setInterval(PricingInterval interval) { this.interval = interval; } public Pricing dividedBy(Long dividedBy) { - this.dividedBy = dividedBy; return this; } - /** + /** * Group of n product unit labels * @return dividedBy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1048576", value = "Group of n product unit labels") - public Long getDividedBy() { return dividedBy; } - public void setDividedBy(Long dividedBy) { this.dividedBy = dividedBy; } public Pricing charge(Double charge) { - this.charge = charge; return this; } - /** + /** * Price in cents (decimal) per unitlabel * @return charge - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Price in cents (decimal) per unitlabel") - public Double getCharge() { return charge; } - public void setCharge(Double charge) { this.charge = charge; } public Pricing activated(Boolean activated) { - this.activated = activated; return this; } - /** + /** * If pricing is activated * @return activated - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "If pricing is activated") - public Boolean getActivated() { return activated; } - public void setActivated(Boolean activated) { this.activated = activated; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Pricing putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -455,13 +380,12 @@ public boolean equals(Object o) { Objects.equals(this.interval, pricing.interval) && Objects.equals(this.dividedBy, pricing.dividedBy) && Objects.equals(this.charge, pricing.charge) && - Objects.equals(this.activated, pricing.activated)&& - Objects.equals(this.additionalProperties, pricing.additionalProperties); + Objects.equals(this.activated, pricing.activated); } @Override public int hashCode() { - return Objects.hash(id, arrayUuid, pricingName, pricingType, productName, productStatementDescriptor, productUnitLabel, currency, aggregateUsage, interval, dividedBy, charge, activated, additionalProperties); + return Objects.hash(id, arrayUuid, pricingName, pricingType, productName, productStatementDescriptor, productUnitLabel, currency, aggregateUsage, interval, dividedBy, charge, activated); } @Override @@ -481,7 +405,6 @@ public String toString() { sb.append(" dividedBy: ").append(toIndentedString(dividedBy)).append("\n"); sb.append(" charge: ").append(toIndentedString(charge)).append("\n"); sb.append(" activated: ").append(toIndentedString(activated)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -522,35 +445,62 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Pricing - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Pricing.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Pricing + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Pricing.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Pricing is not found in the empty JSON string", Pricing.openapiRequiredFields.toString())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Pricing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pricing` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("array_uuid") != null && !jsonObj.get("array_uuid").isJsonPrimitive()) { + if ((jsonObj.get("array_uuid") != null && !jsonObj.get("array_uuid").isJsonNull()) && !jsonObj.get("array_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `array_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_uuid").toString())); } - if (jsonObj.get("pricing_name") != null && !jsonObj.get("pricing_name").isJsonPrimitive()) { + if ((jsonObj.get("pricing_name") != null && !jsonObj.get("pricing_name").isJsonNull()) && !jsonObj.get("pricing_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `pricing_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricing_name").toString())); } - if (jsonObj.get("product_name") != null && !jsonObj.get("product_name").isJsonPrimitive()) { + // validate the optional field `pricing_type` + if (jsonObj.get("pricing_type") != null && !jsonObj.get("pricing_type").isJsonNull()) { + PricingType.validateJsonElement(jsonObj.get("pricing_type")); + } + if ((jsonObj.get("product_name") != null && !jsonObj.get("product_name").isJsonNull()) && !jsonObj.get("product_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `product_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product_name").toString())); } - if (jsonObj.get("product_statement_descriptor") != null && !jsonObj.get("product_statement_descriptor").isJsonPrimitive()) { + if ((jsonObj.get("product_statement_descriptor") != null && !jsonObj.get("product_statement_descriptor").isJsonNull()) && !jsonObj.get("product_statement_descriptor").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `product_statement_descriptor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("product_statement_descriptor").toString())); } + // validate the optional field `product_unit_label` + if (jsonObj.get("product_unit_label") != null && !jsonObj.get("product_unit_label").isJsonNull()) { + PricingUnitLabel.validateJsonElement(jsonObj.get("product_unit_label")); + } + // validate the optional field `currency` + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonNull()) { + PricingCurrency.validateJsonElement(jsonObj.get("currency")); + } + // validate the optional field `aggregate_usage` + if (jsonObj.get("aggregate_usage") != null && !jsonObj.get("aggregate_usage").isJsonNull()) { + PricingAggregateUsage.validateJsonElement(jsonObj.get("aggregate_usage")); + } + // validate the optional field `interval` + if (jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) { + PricingInterval.validateJsonElement(jsonObj.get("interval")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -568,71 +518,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Pricing value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Pricing read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Pricing instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Pricing given an JSON string - * - * @param jsonString JSON string - * @return An instance of Pricing - * @throws IOException if the JSON string is invalid with respect to Pricing - */ + /** + * Create an instance of Pricing given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pricing + * @throws IOException if the JSON string is invalid with respect to Pricing + */ public static Pricing fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Pricing.class); } - /** - * Convert an instance of Pricing to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Pricing 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/model/PricingAggregateUsage.java b/src/main/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsage.java index 64c1be0..52676b8 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsage.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsage.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -66,5 +67,10 @@ public PricingAggregateUsage read(final JsonReader jsonReader) throws IOExceptio return PricingAggregateUsage.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PricingAggregateUsage.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/PricingCurrency.java b/src/main/java/io/tiledb/cloud/rest_api/model/PricingCurrency.java index bed28d5..c9dc5d0 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PricingCurrency.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PricingCurrency.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -66,5 +67,10 @@ public PricingCurrency read(final JsonReader jsonReader) throws IOException { return PricingCurrency.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PricingCurrency.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/PricingInterval.java b/src/main/java/io/tiledb/cloud/rest_api/model/PricingInterval.java index 6930160..ee267ac 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PricingInterval.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PricingInterval.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -66,5 +67,10 @@ public PricingInterval read(final JsonReader jsonReader) throws IOException { return PricingInterval.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PricingInterval.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/PricingType.java b/src/main/java/io/tiledb/cloud/rest_api/model/PricingType.java index 46dedd9..1606108 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PricingType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PricingType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public PricingType read(final JsonReader jsonReader) throws IOException { return PricingType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PricingType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/PricingUnitLabel.java b/src/main/java/io/tiledb/cloud/rest_api/model/PricingUnitLabel.java index cabe32b..82edb1a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PricingUnitLabel.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PricingUnitLabel.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public PricingUnitLabel read(final JsonReader jsonReader) throws IOException { return PricingUnitLabel.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PricingUnitLabel.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/PublicShareFilter.java b/src/main/java/io/tiledb/cloud/rest_api/model/PublicShareFilter.java index 6555480..b7ee8e1 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/PublicShareFilter.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/PublicShareFilter.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public PublicShareFilter read(final JsonReader jsonReader) throws IOException { return PublicShareFilter.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PublicShareFilter.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/Query.java b/src/main/java/io/tiledb/cloud/rest_api/model/Query.java index 2dcf6e4..c74277d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Query.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Query.java @@ -14,28 +14,42 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AttributeBufferHeader; +import io.tiledb.cloud.rest_api.model.Layout; +import io.tiledb.cloud.rest_api.model.QueryReader; +import io.tiledb.cloud.rest_api.model.Querystatus; +import io.tiledb.cloud.rest_api.model.Querytype; +import io.tiledb.cloud.rest_api.model.Writer; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,7 +57,7 @@ /** * Query */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Query { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -81,255 +95,187 @@ public class Query { @SerializedName(SERIALIZED_NAME_TOTAL_VAR_LEN_BUFFER_BYTES) private Integer totalVarLenBufferBytes; - public Query() { + public Query() { } public Query type(Querytype type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Querytype getType() { return type; } - public void setType(Querytype type) { this.type = type; } public Query layout(Layout layout) { - this.layout = layout; return this; } - /** + /** * Get layout * @return layout - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Layout getLayout() { return layout; } - public void setLayout(Layout layout) { this.layout = layout; } public Query status(Querystatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Querystatus getStatus() { return status; } - public void setStatus(Querystatus status) { this.status = status; } public Query attributeBufferHeaders(List attributeBufferHeaders) { - this.attributeBufferHeaders = attributeBufferHeaders; return this; } public Query addAttributeBufferHeadersItem(AttributeBufferHeader attributeBufferHeadersItem) { + if (this.attributeBufferHeaders == null) { + this.attributeBufferHeaders = new ArrayList<>(); + } this.attributeBufferHeaders.add(attributeBufferHeadersItem); return this; } - /** + /** * List of attribute buffer headers * @return attributeBufferHeaders - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "List of attribute buffer headers") - public List getAttributeBufferHeaders() { return attributeBufferHeaders; } - public void setAttributeBufferHeaders(List attributeBufferHeaders) { this.attributeBufferHeaders = attributeBufferHeaders; } public Query writer(Writer writer) { - this.writer = writer; return this; } - /** + /** * Get writer * @return writer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Writer getWriter() { return writer; } - public void setWriter(Writer writer) { this.writer = writer; } public Query reader(QueryReader reader) { - this.reader = reader; return this; } - /** + /** * Get reader * @return reader - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public QueryReader getReader() { return reader; } - public void setReader(QueryReader reader) { this.reader = reader; } public Query array(Array array) { - this.array = array; return this; } - /** + /** * Get array * @return array - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Array getArray() { return array; } - public void setArray(Array array) { this.array = array; } public Query totalFixedLengthBufferBytes(Integer totalFixedLengthBufferBytes) { - this.totalFixedLengthBufferBytes = totalFixedLengthBufferBytes; return this; } - /** + /** * Total number of bytes in fixed size attribute buffers. * @return totalFixedLengthBufferBytes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Total number of bytes in fixed size attribute buffers.") - public Integer getTotalFixedLengthBufferBytes() { return totalFixedLengthBufferBytes; } - public void setTotalFixedLengthBufferBytes(Integer totalFixedLengthBufferBytes) { this.totalFixedLengthBufferBytes = totalFixedLengthBufferBytes; } public Query totalVarLenBufferBytes(Integer totalVarLenBufferBytes) { - this.totalVarLenBufferBytes = totalVarLenBufferBytes; return this; } - /** + /** * Total number of bytes in variable size attribute buffers. * @return totalVarLenBufferBytes - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Total number of bytes in variable size attribute buffers.") - public Integer getTotalVarLenBufferBytes() { return totalVarLenBufferBytes; } - public void setTotalVarLenBufferBytes(Integer totalVarLenBufferBytes) { this.totalVarLenBufferBytes = totalVarLenBufferBytes; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Query putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -349,13 +295,12 @@ public boolean equals(Object o) { Objects.equals(this.reader, query.reader) && Objects.equals(this.array, query.array) && Objects.equals(this.totalFixedLengthBufferBytes, query.totalFixedLengthBufferBytes) && - Objects.equals(this.totalVarLenBufferBytes, query.totalVarLenBufferBytes)&& - Objects.equals(this.additionalProperties, query.additionalProperties); + Objects.equals(this.totalVarLenBufferBytes, query.totalVarLenBufferBytes); } @Override public int hashCode() { - return Objects.hash(type, layout, status, attributeBufferHeaders, writer, reader, array, totalFixedLengthBufferBytes, totalVarLenBufferBytes, additionalProperties); + return Objects.hash(type, layout, status, attributeBufferHeaders, writer, reader, array, totalFixedLengthBufferBytes, totalVarLenBufferBytes); } @Override @@ -371,7 +316,6 @@ public String toString() { sb.append(" array: ").append(toIndentedString(array)).append("\n"); sb.append(" totalFixedLengthBufferBytes: ").append(toIndentedString(totalFixedLengthBufferBytes)).append("\n"); sb.append(" totalVarLenBufferBytes: ").append(toIndentedString(totalVarLenBufferBytes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -415,51 +359,60 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("totalVarLenBufferBytes"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Query - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Query.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Query + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Query is not found in the empty JSON string", Query.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Query` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Query.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - JsonArray jsonArrayattributeBufferHeaders = jsonObj.getAsJsonArray("attributeBufferHeaders"); - if (jsonArrayattributeBufferHeaders != null) { - // ensure the json data is an array - if (!jsonObj.get("attributeBufferHeaders").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `attributeBufferHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("attributeBufferHeaders").toString())); - } - - // validate the optional field `attributeBufferHeaders` (array) - for (int i = 0; i < jsonArrayattributeBufferHeaders.size(); i++) { - AttributeBufferHeader.validateJsonObject(jsonArrayattributeBufferHeaders.get(i).getAsJsonObject()); - }; + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `type` + Querytype.validateJsonElement(jsonObj.get("type")); + // validate the required field `layout` + Layout.validateJsonElement(jsonObj.get("layout")); + // validate the required field `status` + Querystatus.validateJsonElement(jsonObj.get("status")); + // ensure the json data is an array + if (!jsonObj.get("attributeBufferHeaders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `attributeBufferHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("attributeBufferHeaders").toString())); } + + JsonArray jsonArrayattributeBufferHeaders = jsonObj.getAsJsonArray("attributeBufferHeaders"); + // validate the required field `attributeBufferHeaders` (array) + for (int i = 0; i < jsonArrayattributeBufferHeaders.size(); i++) { + AttributeBufferHeader.validateJsonElement(jsonArrayattributeBufferHeaders.get(i)); + }; // validate the optional field `writer` - if (jsonObj.getAsJsonObject("writer") != null) { - Writer.validateJsonObject(jsonObj.getAsJsonObject("writer")); + if (jsonObj.get("writer") != null && !jsonObj.get("writer").isJsonNull()) { + Writer.validateJsonElement(jsonObj.get("writer")); } // validate the optional field `reader` - if (jsonObj.getAsJsonObject("reader") != null) { - QueryReader.validateJsonObject(jsonObj.getAsJsonObject("reader")); - } - // validate the optional field `array` - if (jsonObj.getAsJsonObject("array") != null) { - Array.validateJsonObject(jsonObj.getAsJsonObject("array")); + if (jsonObj.get("reader") != null && !jsonObj.get("reader").isJsonNull()) { + QueryReader.validateJsonElement(jsonObj.get("reader")); } + // validate the required field `array` + Array.validateJsonElement(jsonObj.get("array")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -477,71 +430,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Query value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Query read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Query instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Query given an JSON string - * - * @param jsonString JSON string - * @return An instance of Query - * @throws IOException if the JSON string is invalid with respect to Query - */ + /** + * Create an instance of Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of Query + * @throws IOException if the JSON string is invalid with respect to Query + */ public static Query fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Query.class); } - /** - * Convert an instance of Query to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Query 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/model/QueryJson.java b/src/main/java/io/tiledb/cloud/rest_api/model/QueryJson.java index 4b812b8..c36dd4d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/QueryJson.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/QueryJson.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.QueryRanges; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +52,7 @@ /** * Query returning results as JSON */ -@ApiModel(description = "Query returning results as JSON") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class QueryJson { public static final String SERIALIZED_NAME_QUERY_RANGES = "query_ranges"; @SerializedName(SERIALIZED_NAME_QUERY_RANGES) @@ -52,36 +60,31 @@ public class QueryJson { public static final String SERIALIZED_NAME_FIELDS = "fields"; @SerializedName(SERIALIZED_NAME_FIELDS) - private List fields = null; + private List fields = new ArrayList<>(); - public QueryJson() { + public QueryJson() { } public QueryJson queryRanges(QueryRanges queryRanges) { - this.queryRanges = queryRanges; return this; } - /** + /** * Get queryRanges * @return queryRanges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public QueryRanges getQueryRanges() { return queryRanges; } - public void setQueryRanges(QueryRanges queryRanges) { this.queryRanges = queryRanges; } public QueryJson fields(List fields) { - this.fields = fields; return this; } @@ -94,57 +97,19 @@ public QueryJson addFieldsItem(String fieldsItem) { return this; } - /** + /** * List of fields to return data from, empty means return data for all fields * @return fields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of fields to return data from, empty means return data for all fields") - public List getFields() { return fields; } - public void setFields(List fields) { this.fields = fields; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public QueryJson putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +122,12 @@ public boolean equals(Object o) { } QueryJson queryJson = (QueryJson) o; return Objects.equals(this.queryRanges, queryJson.queryRanges) && - Objects.equals(this.fields, queryJson.fields)&& - Objects.equals(this.additionalProperties, queryJson.additionalProperties); + Objects.equals(this.fields, queryJson.fields); } @Override public int hashCode() { - return Objects.hash(queryRanges, fields, additionalProperties); + return Objects.hash(queryRanges, fields); } @Override @@ -172,7 +136,6 @@ public String toString() { sb.append("class QueryJson {\n"); sb.append(" queryRanges: ").append(toIndentedString(queryRanges)).append("\n"); sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,26 +165,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to QueryJson - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (QueryJson.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 QueryJson + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryJson.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in QueryJson is not found in the empty JSON string", QueryJson.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!QueryJson.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryJson` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `query_ranges` - if (jsonObj.getAsJsonObject("query_ranges") != null) { - QueryRanges.validateJsonObject(jsonObj.getAsJsonObject("query_ranges")); + if (jsonObj.get("query_ranges") != null && !jsonObj.get("query_ranges").isJsonNull()) { + QueryRanges.validateJsonElement(jsonObj.get("query_ranges")); } - // ensure the json data is an array - if (jsonObj.get("fields") != null && !jsonObj.get("fields").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("fields") != null && !jsonObj.get("fields").isJsonNull() && !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())); } } @@ -241,71 +211,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, QueryJson value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public QueryJson read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - QueryJson instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of QueryJson given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryJson - * @throws IOException if the JSON string is invalid with respect to QueryJson - */ + /** + * Create an instance of QueryJson given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryJson + * @throws IOException if the JSON string is invalid with respect to QueryJson + */ public static QueryJson fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, QueryJson.class); } - /** - * Convert an instance of QueryJson to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of QueryJson 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/model/QueryRanges.java b/src/main/java/io/tiledb/cloud/rest_api/model/QueryRanges.java index 77ebfe4..4b79707 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/QueryRanges.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/QueryRanges.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Layout; import java.io.IOException; import java.math.BigDecimal; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +53,7 @@ /** * Subarray bounds to query */ -@ApiModel(description = "Subarray bounds to query") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class QueryRanges { public static final String SERIALIZED_NAME_LAYOUT = "layout"; @SerializedName(SERIALIZED_NAME_LAYOUT) @@ -53,36 +61,31 @@ public class QueryRanges { public static final String SERIALIZED_NAME_RANGES = "ranges"; @SerializedName(SERIALIZED_NAME_RANGES) - private List> ranges = null; + private List> ranges = new ArrayList<>(); - public QueryRanges() { + public QueryRanges() { } public QueryRanges layout(Layout layout) { - this.layout = layout; return this; } - /** + /** * Get layout * @return layout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Layout getLayout() { return layout; } - public void setLayout(Layout layout) { this.layout = layout; } public QueryRanges ranges(List> ranges) { - this.ranges = ranges; return this; } @@ -95,57 +98,19 @@ public QueryRanges addRangesItem(List rangesItem) { return this; } - /** + /** * List of ranges, * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of ranges,") - public List> getRanges() { return ranges; } - public void setRanges(List> ranges) { this.ranges = ranges; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public QueryRanges putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } QueryRanges queryRanges = (QueryRanges) o; return Objects.equals(this.layout, queryRanges.layout) && - Objects.equals(this.ranges, queryRanges.ranges)&& - Objects.equals(this.additionalProperties, queryRanges.additionalProperties); + Objects.equals(this.ranges, queryRanges.ranges); } @Override public int hashCode() { - return Objects.hash(layout, ranges, additionalProperties); + return Objects.hash(layout, ranges); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class QueryRanges {\n"); sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,22 +166,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to QueryRanges - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (QueryRanges.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 QueryRanges + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryRanges.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in QueryRanges is not found in the empty JSON string", QueryRanges.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!QueryRanges.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryRanges` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `layout` + if (jsonObj.get("layout") != null && !jsonObj.get("layout").isJsonNull()) { + Layout.validateJsonElement(jsonObj.get("layout")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull() && !jsonObj.get("ranges").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); } } @@ -238,71 +212,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, QueryRanges value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public QueryRanges read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - QueryRanges instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of QueryRanges given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryRanges - * @throws IOException if the JSON string is invalid with respect to QueryRanges - */ + /** + * Create an instance of QueryRanges given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryRanges + * @throws IOException if the JSON string is invalid with respect to QueryRanges + */ public static QueryRanges fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, QueryRanges.class); } - /** - * Convert an instance of QueryRanges to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of QueryRanges 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/model/QueryReader.java b/src/main/java/io/tiledb/cloud/rest_api/model/QueryReader.java index ee9e631..b23995e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/QueryReader.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/QueryReader.java @@ -14,26 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Layout; +import io.tiledb.cloud.rest_api.model.ReadState; +import io.tiledb.cloud.rest_api.model.Subarray; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +52,7 @@ /** * Read struct (can't be called reader due to class name conflict) */ -@ApiModel(description = "Read struct (can't be called reader due to class name conflict)") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class QueryReader { public static final String SERIALIZED_NAME_LAYOUT = "layout"; @SerializedName(SERIALIZED_NAME_LAYOUT) @@ -68,181 +78,122 @@ public class QueryReader { @SerializedName(SERIALIZED_NAME_VAR_OFFSETS_BITSIZE) private Integer varOffsetsBitsize; - public QueryReader() { + public QueryReader() { } public QueryReader layout(Layout layout) { - this.layout = layout; return this; } - /** + /** * Get layout * @return layout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Layout getLayout() { return layout; } - public void setLayout(Layout layout) { this.layout = layout; } public QueryReader subarray(Subarray subarray) { - this.subarray = subarray; return this; } - /** + /** * Get subarray * @return subarray - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Subarray getSubarray() { return subarray; } - public void setSubarray(Subarray subarray) { this.subarray = subarray; } public QueryReader readState(ReadState readState) { - this.readState = readState; return this; } - /** + /** * Get readState * @return readState - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ReadState getReadState() { return readState; } - public void setReadState(ReadState readState) { this.readState = readState; } public QueryReader varOffsetsMode(String varOffsetsMode) { - this.varOffsetsMode = varOffsetsMode; return this; } - /** + /** * The offsets format (bytes or elements) to be used. * @return varOffsetsMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The offsets format (bytes or elements) to be used.") - public String getVarOffsetsMode() { return varOffsetsMode; } - public void setVarOffsetsMode(String varOffsetsMode) { this.varOffsetsMode = varOffsetsMode; } public QueryReader varOffsetsAddExtraElement(Boolean varOffsetsAddExtraElement) { - this.varOffsetsAddExtraElement = varOffsetsAddExtraElement; return this; } - /** + /** * True if an extra element will be added to the end of the offsets buffer. * @return varOffsetsAddExtraElement - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if an extra element will be added to the end of the offsets buffer.") - public Boolean getVarOffsetsAddExtraElement() { return varOffsetsAddExtraElement; } - public void setVarOffsetsAddExtraElement(Boolean varOffsetsAddExtraElement) { this.varOffsetsAddExtraElement = varOffsetsAddExtraElement; } public QueryReader varOffsetsBitsize(Integer varOffsetsBitsize) { - this.varOffsetsBitsize = varOffsetsBitsize; return this; } - /** + /** * The offsets bitsize (32 or 64) to be used. * @return varOffsetsBitsize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The offsets bitsize (32 or 64) to be used.") - public Integer getVarOffsetsBitsize() { return varOffsetsBitsize; } - public void setVarOffsetsBitsize(Integer varOffsetsBitsize) { this.varOffsetsBitsize = varOffsetsBitsize; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public QueryReader putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -259,13 +210,12 @@ public boolean equals(Object o) { Objects.equals(this.readState, queryReader.readState) && Objects.equals(this.varOffsetsMode, queryReader.varOffsetsMode) && Objects.equals(this.varOffsetsAddExtraElement, queryReader.varOffsetsAddExtraElement) && - Objects.equals(this.varOffsetsBitsize, queryReader.varOffsetsBitsize)&& - Objects.equals(this.additionalProperties, queryReader.additionalProperties); + Objects.equals(this.varOffsetsBitsize, queryReader.varOffsetsBitsize); } @Override public int hashCode() { - return Objects.hash(layout, subarray, readState, varOffsetsMode, varOffsetsAddExtraElement, varOffsetsBitsize, additionalProperties); + return Objects.hash(layout, subarray, readState, varOffsetsMode, varOffsetsAddExtraElement, varOffsetsBitsize); } @Override @@ -278,7 +228,6 @@ public String toString() { sb.append(" varOffsetsMode: ").append(toIndentedString(varOffsetsMode)).append("\n"); sb.append(" varOffsetsAddExtraElement: ").append(toIndentedString(varOffsetsAddExtraElement)).append("\n"); sb.append(" varOffsetsBitsize: ").append(toIndentedString(varOffsetsBitsize)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -312,29 +261,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to QueryReader - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (QueryReader.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 QueryReader + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryReader.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in QueryReader is not found in the empty JSON string", QueryReader.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!QueryReader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryReader` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `layout` + if (jsonObj.get("layout") != null && !jsonObj.get("layout").isJsonNull()) { + Layout.validateJsonElement(jsonObj.get("layout")); + } // validate the optional field `subarray` - if (jsonObj.getAsJsonObject("subarray") != null) { - Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + if (jsonObj.get("subarray") != null && !jsonObj.get("subarray").isJsonNull()) { + Subarray.validateJsonElement(jsonObj.get("subarray")); } // validate the optional field `readState` - if (jsonObj.getAsJsonObject("readState") != null) { - ReadState.validateJsonObject(jsonObj.getAsJsonObject("readState")); + if (jsonObj.get("readState") != null && !jsonObj.get("readState").isJsonNull()) { + ReadState.validateJsonElement(jsonObj.get("readState")); } - if (jsonObj.get("varOffsetsMode") != null && !jsonObj.get("varOffsetsMode").isJsonPrimitive()) { + if ((jsonObj.get("varOffsetsMode") != null && !jsonObj.get("varOffsetsMode").isJsonNull()) && !jsonObj.get("varOffsetsMode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `varOffsetsMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("varOffsetsMode").toString())); } } @@ -354,71 +314,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, QueryReader value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public QueryReader read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - QueryReader instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of QueryReader given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryReader - * @throws IOException if the JSON string is invalid with respect to QueryReader - */ + /** + * Create an instance of QueryReader given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryReader + * @throws IOException if the JSON string is invalid with respect to QueryReader + */ public static QueryReader fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, QueryReader.class); } - /** - * Convert an instance of QueryReader to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of QueryReader 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/model/Querystatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/Querystatus.java index ef13838..8a07512 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Querystatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Querystatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -74,5 +75,10 @@ public Querystatus read(final JsonReader jsonReader) throws IOException { return Querystatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Querystatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/Querytype.java b/src/main/java/io/tiledb/cloud/rest_api/model/Querytype.java index 917ebc0..4ad6cc2 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Querytype.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Querytype.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public Querytype read(final JsonReader jsonReader) throws IOException { return Querytype.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Querytype.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/ReadState.java b/src/main/java/io/tiledb/cloud/rest_api/model/ReadState.java index d197442..cb7e71d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ReadState.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ReadState.java @@ -14,34 +14,43 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.SubarrayPartitioner; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * state for reads */ -@ApiModel(description = "state for reads") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ReadState { public static final String SERIALIZED_NAME_INITIALIZED = "initialized"; @SerializedName(SERIALIZED_NAME_INITIALIZED) @@ -59,135 +68,84 @@ public class ReadState { @SerializedName(SERIALIZED_NAME_SUBARRAY_PARTITIONER) private SubarrayPartitioner subarrayPartitioner; - public ReadState() { + public ReadState() { } public ReadState initialized(Boolean initialized) { - this.initialized = initialized; return this; } - /** + /** * True if the reader has been initialized. * @return initialized - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if the reader has been initialized.") - public Boolean getInitialized() { return initialized; } - public void setInitialized(Boolean initialized) { this.initialized = initialized; } public ReadState overflowed(Boolean overflowed) { - this.overflowed = overflowed; return this; } - /** + /** * True if the query produced results that could not fit in some buffer. * @return overflowed - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if the query produced results that could not fit in some buffer.") - public Boolean getOverflowed() { return overflowed; } - public void setOverflowed(Boolean overflowed) { this.overflowed = overflowed; } public ReadState unsplittable(Boolean unsplittable) { - this.unsplittable = unsplittable; return this; } - /** + /** * True if the current subarray partition is unsplittable. * @return unsplittable - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if the current subarray partition is unsplittable.") - public Boolean getUnsplittable() { return unsplittable; } - public void setUnsplittable(Boolean unsplittable) { this.unsplittable = unsplittable; } public ReadState subarrayPartitioner(SubarrayPartitioner subarrayPartitioner) { - this.subarrayPartitioner = subarrayPartitioner; return this; } - /** + /** * Get subarrayPartitioner * @return subarrayPartitioner - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public SubarrayPartitioner getSubarrayPartitioner() { return subarrayPartitioner; } - public void setSubarrayPartitioner(SubarrayPartitioner subarrayPartitioner) { this.subarrayPartitioner = subarrayPartitioner; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ReadState putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -202,13 +160,12 @@ public boolean equals(Object o) { return Objects.equals(this.initialized, readState.initialized) && Objects.equals(this.overflowed, readState.overflowed) && Objects.equals(this.unsplittable, readState.unsplittable) && - Objects.equals(this.subarrayPartitioner, readState.subarrayPartitioner)&& - Objects.equals(this.additionalProperties, readState.additionalProperties); + Objects.equals(this.subarrayPartitioner, readState.subarrayPartitioner); } @Override public int hashCode() { - return Objects.hash(initialized, overflowed, unsplittable, subarrayPartitioner, additionalProperties); + return Objects.hash(initialized, overflowed, unsplittable, subarrayPartitioner); } @Override @@ -219,7 +176,6 @@ public String toString() { sb.append(" overflowed: ").append(toIndentedString(overflowed)).append("\n"); sb.append(" unsplittable: ").append(toIndentedString(unsplittable)).append("\n"); sb.append(" subarrayPartitioner: ").append(toIndentedString(subarrayPartitioner)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -251,23 +207,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ReadState - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ReadState.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ReadState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadState.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ReadState is not found in the empty JSON string", ReadState.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadState` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `subarrayPartitioner` - if (jsonObj.getAsJsonObject("subarrayPartitioner") != null) { - SubarrayPartitioner.validateJsonObject(jsonObj.getAsJsonObject("subarrayPartitioner")); + if (jsonObj.get("subarrayPartitioner") != null && !jsonObj.get("subarrayPartitioner").isJsonNull()) { + SubarrayPartitioner.validateJsonElement(jsonObj.get("subarrayPartitioner")); } } @@ -286,71 +249,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ReadState value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ReadState read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ReadState instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ReadState given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadState - * @throws IOException if the JSON string is invalid with respect to ReadState - */ + /** + * Create an instance of ReadState given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadState + * @throws IOException if the JSON string is invalid with respect to ReadState + */ public static ReadState fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ReadState.class); } - /** - * Convert an instance of ReadState to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ReadState 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/model/RegisteredTaskGraph.java b/src/main/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraph.java index 57ee6b7..c664f48 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraph.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraph.java @@ -14,31 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TaskGraphNode; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -46,8 +53,7 @@ /** * The structure and metadata of a task graph that can be stored on TileDB Cloud and executed by users who have access to it. */ -@ApiModel(description = "The structure and metadata of a task graph that can be stored on TileDB Cloud and executed by users who have access to it. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class RegisteredTaskGraph { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) @@ -75,155 +81,130 @@ public class RegisteredTaskGraph { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); public static final String SERIALIZED_NAME_NODES = "nodes"; @SerializedName(SERIALIZED_NAME_NODES) - private List nodes = null; + private List nodes = new ArrayList<>(); - public RegisteredTaskGraph() { + public RegisteredTaskGraph() { } public RegisteredTaskGraph uuid(String uuid) { - this.uuid = uuid; return this; } - /** + /** * A server-assigned unique ID for the UDF, in UUID format. * @return uuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A server-assigned unique ID for the UDF, in UUID format.") - public String getUuid() { return uuid; } - public void setUuid(String uuid) { this.uuid = uuid; } public RegisteredTaskGraph namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * The namespace that owns this task graph log. * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The namespace that owns this task graph log.") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public RegisteredTaskGraph name(String name) { - this.name = name; return this; } - /** + /** * The name of this graph, to appear in URLs. Must be unique per-namespace. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of this graph, to appear in URLs. Must be unique per-namespace. ") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public RegisteredTaskGraph readme(String readme) { - this.readme = readme; return this; } - /** + /** * Documentation for the task graph, in Markdown format. * @return readme - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Documentation for the task graph, in Markdown format.") - public String getReadme() { return readme; } - public void setReadme(String readme) { this.readme = readme; } public RegisteredTaskGraph licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * SPDX license identifier. * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "SPDX license identifier.") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public RegisteredTaskGraph licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * Full text of the license. * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Full text of the license.") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } public RegisteredTaskGraph tags(List tags) { - this.tags = tags; return this; } @@ -236,25 +217,21 @@ public RegisteredTaskGraph addTagsItem(String tagsItem) { return this; } - /** + /** * Optional tags to classify the graph. * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional tags to classify the graph.") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } public RegisteredTaskGraph nodes(List nodes) { - this.nodes = nodes; return this; } @@ -267,57 +244,19 @@ public RegisteredTaskGraph addNodesItem(TaskGraphNode nodesItem) { return this; } - /** + /** * The structure of the graph, in the form of the nodes that make it up. As with `TaskGraphLog`, nodes must topologically sorted, so that any node appears after all the nodes it depends on. * @return nodes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The structure of the graph, in the form of the nodes that make it up. As with `TaskGraphLog`, nodes must topologically sorted, so that any node appears after all the nodes it depends on. ") - public List getNodes() { return nodes; } - public void setNodes(List nodes) { this.nodes = nodes; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public RegisteredTaskGraph putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -336,8 +275,7 @@ public boolean equals(Object o) { Objects.equals(this.licenseId, registeredTaskGraph.licenseId) && Objects.equals(this.licenseText, registeredTaskGraph.licenseText) && Objects.equals(this.tags, registeredTaskGraph.tags) && - Objects.equals(this.nodes, registeredTaskGraph.nodes)&& - Objects.equals(this.additionalProperties, registeredTaskGraph.additionalProperties); + Objects.equals(this.nodes, registeredTaskGraph.nodes); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -346,7 +284,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(uuid, namespace, name, readme, licenseId, licenseText, tags, nodes, additionalProperties); + return Objects.hash(uuid, namespace, name, readme, licenseId, licenseText, tags, nodes); } private static int hashCodeNullable(JsonNullable a) { @@ -368,7 +306,6 @@ public String toString() { sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -404,53 +341,62 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to RegisteredTaskGraph - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (RegisteredTaskGraph.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 RegisteredTaskGraph + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RegisteredTaskGraph.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RegisteredTaskGraph is not found in the empty JSON string", RegisteredTaskGraph.openapiRequiredFields.toString())); } } - if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RegisteredTaskGraph.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RegisteredTaskGraph` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("readme") != null && !jsonObj.get("readme").isJsonPrimitive()) { + if ((jsonObj.get("readme") != null && !jsonObj.get("readme").isJsonNull()) && !jsonObj.get("readme").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `readme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("readme").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } - JsonArray jsonArraynodes = jsonObj.getAsJsonArray("nodes"); - if (jsonArraynodes != null) { - // ensure the json data is an array - if (!jsonObj.get("nodes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `nodes` to be an array in the JSON string but got `%s`", jsonObj.get("nodes").toString())); + if (jsonObj.get("nodes") != null && !jsonObj.get("nodes").isJsonNull()) { + JsonArray jsonArraynodes = jsonObj.getAsJsonArray("nodes"); + if (jsonArraynodes != null) { + // ensure the json data is an array + if (!jsonObj.get("nodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodes` to be an array in the JSON string but got `%s`", jsonObj.get("nodes").toString())); + } + + // validate the optional field `nodes` (array) + for (int i = 0; i < jsonArraynodes.size(); i++) { + TaskGraphNode.validateJsonElement(jsonArraynodes.get(i)); + }; } - - // validate the optional field `nodes` (array) - for (int i = 0; i < jsonArraynodes.size(); i++) { - TaskGraphNode.validateJsonObject(jsonArraynodes.get(i).getAsJsonObject()); - }; } } @@ -469,71 +415,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, RegisteredTaskGraph value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public RegisteredTaskGraph read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - RegisteredTaskGraph instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of RegisteredTaskGraph given an JSON string - * - * @param jsonString JSON string - * @return An instance of RegisteredTaskGraph - * @throws IOException if the JSON string is invalid with respect to RegisteredTaskGraph - */ + /** + * Create an instance of RegisteredTaskGraph given an JSON string + * + * @param jsonString JSON string + * @return An instance of RegisteredTaskGraph + * @throws IOException if the JSON string is invalid with respect to RegisteredTaskGraph + */ public static RegisteredTaskGraph fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RegisteredTaskGraph.class); } - /** - * Convert an instance of RegisteredTaskGraph to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RegisteredTaskGraph 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/model/ResetUserPasswordRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequest.java index fcee897..f9f9654 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequest.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,73 +49,33 @@ /** * Password to update */ -@ApiModel(description = "Password to update") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ResetUserPasswordRequest { public static final String SERIALIZED_NAME_PASSWORD = "password"; @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; - public ResetUserPasswordRequest() { + public ResetUserPasswordRequest() { } public ResetUserPasswordRequest password(String password) { - this.password = password; return this; } - /** + /** * password * @return password - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "password", value = "password") - public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ResetUserPasswordRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -119,13 +87,12 @@ public boolean equals(Object o) { return false; } ResetUserPasswordRequest resetUserPasswordRequest = (ResetUserPasswordRequest) o; - return Objects.equals(this.password, resetUserPasswordRequest.password)&& - Objects.equals(this.additionalProperties, resetUserPasswordRequest.additionalProperties); + return Objects.equals(this.password, resetUserPasswordRequest.password); } @Override public int hashCode() { - return Objects.hash(password, additionalProperties); + return Objects.hash(password); } @Override @@ -133,7 +100,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ResetUserPasswordRequest {\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -162,21 +128,28 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ResetUserPasswordRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ResetUserPasswordRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 ResetUserPasswordRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetUserPasswordRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in ResetUserPasswordRequest is not found in the empty JSON string", ResetUserPasswordRequest.openapiRequiredFields.toString())); } } - if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ResetUserPasswordRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResetUserPasswordRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) && !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())); } } @@ -196,71 +169,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ResetUserPasswordRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public ResetUserPasswordRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ResetUserPasswordRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of ResetUserPasswordRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ResetUserPasswordRequest - * @throws IOException if the JSON string is invalid with respect to ResetUserPasswordRequest - */ + /** + * Create an instance of ResetUserPasswordRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetUserPasswordRequest + * @throws IOException if the JSON string is invalid with respect to ResetUserPasswordRequest + */ public static ResetUserPasswordRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ResetUserPasswordRequest.class); } - /** - * Convert an instance of ResetUserPasswordRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ResetUserPasswordRequest 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/model/ResultFormat.java b/src/main/java/io/tiledb/cloud/rest_api/model/ResultFormat.java index 9becf5c..fafbf1e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/ResultFormat.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/ResultFormat.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -78,5 +79,10 @@ public ResultFormat read(final JsonReader jsonReader) throws IOException { return ResultFormat.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResultFormat.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/RetryPolicy.java b/src/main/java/io/tiledb/cloud/rest_api/model/RetryPolicy.java index 1cec21f..49c833f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/RetryPolicy.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/RetryPolicy.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -30,11 +31,11 @@ public enum RetryPolicy { ALWAYS("Always"), - ONFAILURE("OnFailure"), + ON_FAILURE("OnFailure"), - ONERROR("OnError"), + ON_ERROR("OnError"), - ONTRANSIENTERROR("OnTransientError"); + ON_TRANSIENT_ERROR("OnTransientError"); private String value; @@ -72,5 +73,10 @@ public RetryPolicy read(final JsonReader jsonReader) throws IOException { return RetryPolicy.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RetryPolicy.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/RetryStrategy.java b/src/main/java/io/tiledb/cloud/rest_api/model/RetryStrategy.java index bbb2e09..9188def 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/RetryStrategy.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/RetryStrategy.java @@ -14,26 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Backoff; +import io.tiledb.cloud.rest_api.model.RetryPolicy; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +51,7 @@ /** * RetryStrategy provides controls on how to retry a taskgraph node */ -@ApiModel(description = "RetryStrategy provides controls on how to retry a taskgraph node") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class RetryStrategy { public static final String SERIALIZED_NAME_BACKOFF = "backoff"; @SerializedName(SERIALIZED_NAME_BACKOFF) @@ -60,135 +69,84 @@ public class RetryStrategy { @SerializedName(SERIALIZED_NAME_RETRY_POLICY) private RetryPolicy retryPolicy; - public RetryStrategy() { + public RetryStrategy() { } public RetryStrategy backoff(Backoff backoff) { - this.backoff = backoff; return this; } - /** + /** * Get backoff * @return backoff - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Backoff getBackoff() { return backoff; } - public void setBackoff(Backoff backoff) { this.backoff = backoff; } public RetryStrategy expression(String expression) { - this.expression = expression; return this; } - /** + /** * Expression is a condition expression for when a node will be retried. If it evaluates to false, the node will not be retried and the retry strategy will be ignored * @return expression - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Expression is a condition expression for when a node will be retried. If it evaluates to false, the node will not be retried and the retry strategy will be ignored") - public String getExpression() { return expression; } - public void setExpression(String expression) { this.expression = expression; } public RetryStrategy limit(Integer limit) { - this.limit = limit; return this; } - /** + /** * Limit is the maximum number of retry attempts when retrying a container. It does not include the original container; the maximum number of total attempts will be `limit + 1`. * @return limit - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Limit is the maximum number of retry attempts when retrying a container. It does not include the original container; the maximum number of total attempts will be `limit + 1`.") - public Integer getLimit() { return limit; } - public void setLimit(Integer limit) { this.limit = limit; } public RetryStrategy retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; return this; } - /** + /** * Get retryPolicy * @return retryPolicy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public RetryPolicy getRetryPolicy() { return retryPolicy; } - public void setRetryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public RetryStrategy putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +161,12 @@ public boolean equals(Object o) { return Objects.equals(this.backoff, retryStrategy.backoff) && Objects.equals(this.expression, retryStrategy.expression) && Objects.equals(this.limit, retryStrategy.limit) && - Objects.equals(this.retryPolicy, retryStrategy.retryPolicy)&& - Objects.equals(this.additionalProperties, retryStrategy.additionalProperties); + Objects.equals(this.retryPolicy, retryStrategy.retryPolicy); } @Override public int hashCode() { - return Objects.hash(backoff, expression, limit, retryPolicy, additionalProperties); + return Objects.hash(backoff, expression, limit, retryPolicy); } @Override @@ -220,7 +177,6 @@ public String toString() { sb.append(" expression: ").append(toIndentedString(expression)).append("\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); sb.append(" retryPolicy: ").append(toIndentedString(retryPolicy)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -252,27 +208,38 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to RetryStrategy - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (RetryStrategy.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 RetryStrategy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RetryStrategy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RetryStrategy is not found in the empty JSON string", RetryStrategy.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RetryStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RetryStrategy` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `backoff` - if (jsonObj.getAsJsonObject("backoff") != null) { - Backoff.validateJsonObject(jsonObj.getAsJsonObject("backoff")); + if (jsonObj.get("backoff") != null && !jsonObj.get("backoff").isJsonNull()) { + Backoff.validateJsonElement(jsonObj.get("backoff")); } - if (jsonObj.get("expression") != null && !jsonObj.get("expression").isJsonPrimitive()) { + if ((jsonObj.get("expression") != null && !jsonObj.get("expression").isJsonNull()) && !jsonObj.get("expression").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `expression` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expression").toString())); } + // validate the optional field `retryPolicy` + if (jsonObj.get("retryPolicy") != null && !jsonObj.get("retryPolicy").isJsonNull()) { + RetryPolicy.validateJsonElement(jsonObj.get("retryPolicy")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -290,71 +257,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, RetryStrategy value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public RetryStrategy read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - RetryStrategy instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of RetryStrategy given an JSON string - * - * @param jsonString JSON string - * @return An instance of RetryStrategy - * @throws IOException if the JSON string is invalid with respect to RetryStrategy - */ + /** + * Create an instance of RetryStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of RetryStrategy + * @throws IOException if the JSON string is invalid with respect to RetryStrategy + */ public static RetryStrategy fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RetryStrategy.class); } - /** - * Convert an instance of RetryStrategy to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RetryStrategy 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/model/SQLParameters.java b/src/main/java/io/tiledb/cloud/rest_api/model/SQLParameters.java index afeebfb..5f31704 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SQLParameters.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SQLParameters.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ResultFormat; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +52,7 @@ /** * Parameters for running sql query */ -@ApiModel(description = "Parameters for running sql query") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SQLParameters { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -76,11 +84,11 @@ public class SQLParameters { public static final String SERIALIZED_NAME_INIT_COMMANDS = "init_commands"; @SerializedName(SERIALIZED_NAME_INIT_COMMANDS) - private List initCommands = null; + private List initCommands = new ArrayList<>(); public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; @SerializedName(SERIALIZED_NAME_PARAMETERS) - private List parameters = null; + private List parameters = new ArrayList<>(); public static final String SERIALIZED_NAME_TASK_GRAPH_UUID = "task_graph_uuid"; @SerializedName(SERIALIZED_NAME_TASK_GRAPH_UUID) @@ -90,172 +98,143 @@ public class SQLParameters { @SerializedName(SERIALIZED_NAME_CLIENT_NODE_UUID) private String clientNodeUuid; - public SQLParameters() { + public SQLParameters() { } public SQLParameters name(String name) { - this.name = name; return this; } - /** + /** * name of task, optional * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of task, optional") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public SQLParameters query(String query) { - this.query = query; return this; } - /** + /** * query to run * @return query - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "query to run") - public String getQuery() { return query; } - public void setQuery(String query) { this.query = query; } public SQLParameters outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * Output array uri * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "s3://my_bucket/my_output_array", value = "Output array uri") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public SQLParameters storeResults(Boolean storeResults) { - this.storeResults = storeResults; return this; } - /** + /** * store results for later retrieval * @return storeResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "store results for later retrieval") - public Boolean getStoreResults() { return storeResults; } - public void setStoreResults(Boolean storeResults) { this.storeResults = storeResults; } public SQLParameters dontDownloadResults(Boolean dontDownloadResults) { - this.dontDownloadResults = dontDownloadResults; return this; } - /** + /** * Set to true to avoid downloading the results of this UDF. Useful for intermediate nodes in a task graph where you will not be using the results of your function. Defaults to false (\"yes download results\"). * @return dontDownloadResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set to true to avoid downloading the results of this UDF. Useful for intermediate nodes in a task graph where you will not be using the results of your function. Defaults to false (\"yes download results\").") - public Boolean getDontDownloadResults() { return dontDownloadResults; } - public void setDontDownloadResults(Boolean dontDownloadResults) { this.dontDownloadResults = dontDownloadResults; } public SQLParameters resourceClass(String resourceClass) { - this.resourceClass = resourceClass; return this; } - /** + /** * The resource class to use for the SQL execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the SQL will execute in the standard resource class of the TileDB Cloud provider. * @return resourceClass - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "standard", value = "The resource class to use for the SQL execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the SQL will execute in the standard resource class of the TileDB Cloud provider. ") - public String getResourceClass() { return resourceClass; } - public void setResourceClass(String resourceClass) { this.resourceClass = resourceClass; } public SQLParameters resultFormat(ResultFormat resultFormat) { - this.resultFormat = resultFormat; return this; } - /** + /** * Get resultFormat * @return resultFormat - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ResultFormat getResultFormat() { return resultFormat; } - public void setResultFormat(ResultFormat resultFormat) { this.resultFormat = resultFormat; } public SQLParameters initCommands(List initCommands) { - this.initCommands = initCommands; return this; } @@ -268,25 +247,21 @@ public SQLParameters addInitCommandsItem(String initCommandsItem) { return this; } - /** + /** * Queries or commands to run before main query * @return initCommands - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Queries or commands to run before main query") - public List getInitCommands() { return initCommands; } - public void setInitCommands(List initCommands) { this.initCommands = initCommands; } public SQLParameters parameters(List parameters) { - this.parameters = parameters; return this; } @@ -299,103 +274,57 @@ public SQLParameters addParametersItem(Object parametersItem) { return this; } - /** + /** * SQL query parameters * @return parameters - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "SQL query parameters") - public List getParameters() { return parameters; } - public void setParameters(List parameters) { this.parameters = parameters; } public SQLParameters taskGraphUuid(String taskGraphUuid) { - this.taskGraphUuid = taskGraphUuid; return this; } - /** + /** * If set, the ID of the log for the task graph that this was part of. * @return taskGraphUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the ID of the log for the task graph that this was part of. ") - public String getTaskGraphUuid() { return taskGraphUuid; } - public void setTaskGraphUuid(String taskGraphUuid) { this.taskGraphUuid = taskGraphUuid; } public SQLParameters clientNodeUuid(String clientNodeUuid) { - this.clientNodeUuid = clientNodeUuid; return this; } - /** + /** * If set, the client-defined ID of the node within this task's graph. * @return clientNodeUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the client-defined ID of the node within this task's graph. ") - public String getClientNodeUuid() { return clientNodeUuid; } - public void setClientNodeUuid(String clientNodeUuid) { this.clientNodeUuid = clientNodeUuid; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SQLParameters putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -417,13 +346,12 @@ public boolean equals(Object o) { Objects.equals(this.initCommands, sqLParameters.initCommands) && Objects.equals(this.parameters, sqLParameters.parameters) && Objects.equals(this.taskGraphUuid, sqLParameters.taskGraphUuid) && - Objects.equals(this.clientNodeUuid, sqLParameters.clientNodeUuid)&& - Objects.equals(this.additionalProperties, sqLParameters.additionalProperties); + Objects.equals(this.clientNodeUuid, sqLParameters.clientNodeUuid); } @Override public int hashCode() { - return Objects.hash(name, query, outputUri, storeResults, dontDownloadResults, resourceClass, resultFormat, initCommands, parameters, taskGraphUuid, clientNodeUuid, additionalProperties); + return Objects.hash(name, query, outputUri, storeResults, dontDownloadResults, resourceClass, resultFormat, initCommands, parameters, taskGraphUuid, clientNodeUuid); } @Override @@ -441,7 +369,6 @@ public String toString() { sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); sb.append(" taskGraphUuid: ").append(toIndentedString(taskGraphUuid)).append("\n"); sb.append(" clientNodeUuid: ").append(toIndentedString(clientNodeUuid)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -480,44 +407,55 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SQLParameters - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SQLParameters.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SQLParameters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SQLParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SQLParameters is not found in the empty JSON string", SQLParameters.openapiRequiredFields.toString())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SQLParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SQLParameters` 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("query") != null && !jsonObj.get("query").isJsonPrimitive()) { + if ((jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) && !jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `query` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query").toString())); } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("resource_class") != null && !jsonObj.get("resource_class").isJsonPrimitive()) { + if ((jsonObj.get("resource_class") != null && !jsonObj.get("resource_class").isJsonNull()) && !jsonObj.get("resource_class").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `resource_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource_class").toString())); } - // ensure the json data is an array - if (jsonObj.get("init_commands") != null && !jsonObj.get("init_commands").isJsonArray()) { + // validate the optional field `result_format` + if (jsonObj.get("result_format") != null && !jsonObj.get("result_format").isJsonNull()) { + ResultFormat.validateJsonElement(jsonObj.get("result_format")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("init_commands") != null && !jsonObj.get("init_commands").isJsonNull() && !jsonObj.get("init_commands").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `init_commands` to be an array in the JSON string but got `%s`", jsonObj.get("init_commands").toString())); } - // ensure the json data is an array - if (jsonObj.get("parameters") != null && !jsonObj.get("parameters").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("parameters") != null && !jsonObj.get("parameters").isJsonNull() && !jsonObj.get("parameters").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `parameters` to be an array in the JSON string but got `%s`", jsonObj.get("parameters").toString())); } - if (jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { + if ((jsonObj.get("task_graph_uuid") != null && !jsonObj.get("task_graph_uuid").isJsonNull()) && !jsonObj.get("task_graph_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `task_graph_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_graph_uuid").toString())); } - if (jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { + if ((jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonNull()) && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `client_node_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_uuid").toString())); } } @@ -537,71 +475,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SQLParameters value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SQLParameters read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SQLParameters instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SQLParameters given an JSON string - * - * @param jsonString JSON string - * @return An instance of SQLParameters - * @throws IOException if the JSON string is invalid with respect to SQLParameters - */ + /** + * Create an instance of SQLParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SQLParameters + * @throws IOException if the JSON string is invalid with respect to SQLParameters + */ public static SQLParameters fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SQLParameters.class); } - /** - * Convert an instance of SQLParameters to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SQLParameters 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/model/SSODomainConfig.java b/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainConfig.java index 717d6fc..894e9d3 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainConfig.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainConfig.java @@ -14,31 +14,40 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.DomainCheckResult; +import io.tiledb.cloud.rest_api.model.DomainVerificationStatus; +import io.tiledb.cloud.rest_api.model.SSODomainSetup; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -46,8 +55,7 @@ /** * The information used to set up a single-sign on connection to a customer domain. */ -@ApiModel(description = "The information used to set up a single-sign on connection to a customer domain. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SSODomainConfig { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) @@ -79,174 +87,145 @@ public class SSODomainConfig { public static final String SERIALIZED_NAME_CHECK_RESULTS = "check_results"; @SerializedName(SERIALIZED_NAME_CHECK_RESULTS) - private List checkResults = null; + private List checkResults = new ArrayList<>(); - public SSODomainConfig() { + public SSODomainConfig() { } public SSODomainConfig uuid(String uuid) { - this.uuid = uuid; return this; } - /** + /** * A server-generated ID for the configuration. * @return uuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A server-generated ID for the configuration.") - public String getUuid() { return uuid; } - public void setUuid(String uuid) { this.uuid = uuid; } public SSODomainConfig domain(String domain) { - this.domain = domain; return this; } - /** + /** * The fully-qualified domain (but with no trailing dot) to connect for single sign-on. This may not be changed after creation. * @return domain - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fully-qualified domain (but with no trailing dot) to connect for single sign-on. This may not be changed after creation. ") - public String getDomain() { return domain; } - public void setDomain(String domain) { this.domain = domain; } public SSODomainConfig oidcIssuer(String oidcIssuer) { - this.oidcIssuer = oidcIssuer; return this; } - /** + /** * The URL of the OpenID Connect issuer that can be used to authenticate this domain's users. The prefix where the `/.well-known/openid-configuration` file can be found; usually without a trailing slash. * @return oidcIssuer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the OpenID Connect issuer that can be used to authenticate this domain's users. The prefix where the `/.well-known/openid-configuration` file can be found; usually without a trailing slash. ") - public String getOidcIssuer() { return oidcIssuer; } - public void setOidcIssuer(String oidcIssuer) { this.oidcIssuer = oidcIssuer; } public SSODomainConfig oidcClientId(String oidcClientId) { - this.oidcClientId = oidcClientId; return this; } - /** + /** * The OpenID Connect client ID for this SSO instance. * @return oidcClientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The OpenID Connect client ID for this SSO instance.") - public String getOidcClientId() { return oidcClientId; } - public void setOidcClientId(String oidcClientId) { this.oidcClientId = oidcClientId; } public SSODomainConfig oidcClientSecret(String oidcClientSecret) { - this.oidcClientSecret = oidcClientSecret; return this; } - /** + /** * The OpenID Connect client secret for this SSO instance. * @return oidcClientSecret - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The OpenID Connect client secret for this SSO instance.") - public String getOidcClientSecret() { return oidcClientSecret; } - public void setOidcClientSecret(String oidcClientSecret) { this.oidcClientSecret = oidcClientSecret; } public SSODomainConfig domainSetup(SSODomainSetup domainSetup) { - this.domainSetup = domainSetup; return this; } - /** + /** * Get domainSetup * @return domainSetup - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public SSODomainSetup getDomainSetup() { return domainSetup; } - public void setDomainSetup(SSODomainSetup domainSetup) { this.domainSetup = domainSetup; } public SSODomainConfig verificationStatus(DomainVerificationStatus verificationStatus) { - this.verificationStatus = verificationStatus; return this; } - /** + /** * Get verificationStatus * @return verificationStatus - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DomainVerificationStatus getVerificationStatus() { return verificationStatus; } - public void setVerificationStatus(DomainVerificationStatus verificationStatus) { this.verificationStatus = verificationStatus; } public SSODomainConfig checkResults(List checkResults) { - this.checkResults = checkResults; return this; } @@ -259,57 +238,19 @@ public SSODomainConfig addCheckResultsItem(DomainCheckResult checkResultsItem) { return this; } - /** + /** * A list of the results of recent attempts to verify this domain. * @return checkResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of the results of recent attempts to verify this domain. ") - public List getCheckResults() { return checkResults; } - public void setCheckResults(List checkResults) { this.checkResults = checkResults; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SSODomainConfig putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -328,8 +269,7 @@ public boolean equals(Object o) { Objects.equals(this.oidcClientSecret, ssODomainConfig.oidcClientSecret) && Objects.equals(this.domainSetup, ssODomainConfig.domainSetup) && Objects.equals(this.verificationStatus, ssODomainConfig.verificationStatus) && - Objects.equals(this.checkResults, ssODomainConfig.checkResults)&& - Objects.equals(this.additionalProperties, ssODomainConfig.additionalProperties); + Objects.equals(this.checkResults, ssODomainConfig.checkResults); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -338,7 +278,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(uuid, domain, oidcIssuer, oidcClientId, oidcClientSecret, domainSetup, verificationStatus, checkResults, additionalProperties); + return Objects.hash(uuid, domain, oidcIssuer, oidcClientId, oidcClientSecret, domainSetup, verificationStatus, checkResults); } private static int hashCodeNullable(JsonNullable a) { @@ -360,7 +300,6 @@ public String toString() { sb.append(" domainSetup: ").append(toIndentedString(domainSetup)).append("\n"); sb.append(" verificationStatus: ").append(toIndentedString(verificationStatus)).append("\n"); sb.append(" checkResults: ").append(toIndentedString(checkResults)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -396,50 +335,63 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SSODomainConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SSODomainConfig.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SSODomainConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SSODomainConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SSODomainConfig is not found in the empty JSON string", SSODomainConfig.openapiRequiredFields.toString())); } } - if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SSODomainConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SSODomainConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); } - if (jsonObj.get("domain") != null && !jsonObj.get("domain").isJsonPrimitive()) { + if ((jsonObj.get("domain") != null && !jsonObj.get("domain").isJsonNull()) && !jsonObj.get("domain").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString())); } - if (jsonObj.get("oidc_issuer") != null && !jsonObj.get("oidc_issuer").isJsonPrimitive()) { + if ((jsonObj.get("oidc_issuer") != null && !jsonObj.get("oidc_issuer").isJsonNull()) && !jsonObj.get("oidc_issuer").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `oidc_issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oidc_issuer").toString())); } - if (jsonObj.get("oidc_client_id") != null && !jsonObj.get("oidc_client_id").isJsonPrimitive()) { + if ((jsonObj.get("oidc_client_id") != null && !jsonObj.get("oidc_client_id").isJsonNull()) && !jsonObj.get("oidc_client_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `oidc_client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oidc_client_id").toString())); } - if (jsonObj.get("oidc_client_secret") != null && !jsonObj.get("oidc_client_secret").isJsonPrimitive()) { + if ((jsonObj.get("oidc_client_secret") != null && !jsonObj.get("oidc_client_secret").isJsonNull()) && !jsonObj.get("oidc_client_secret").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `oidc_client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oidc_client_secret").toString())); } // validate the optional field `domain_setup` - if (jsonObj.getAsJsonObject("domain_setup") != null) { - SSODomainSetup.validateJsonObject(jsonObj.getAsJsonObject("domain_setup")); + if (jsonObj.get("domain_setup") != null && !jsonObj.get("domain_setup").isJsonNull()) { + SSODomainSetup.validateJsonElement(jsonObj.get("domain_setup")); } - JsonArray jsonArraycheckResults = jsonObj.getAsJsonArray("check_results"); - if (jsonArraycheckResults != null) { - // ensure the json data is an array - if (!jsonObj.get("check_results").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `check_results` to be an array in the JSON string but got `%s`", jsonObj.get("check_results").toString())); + // validate the optional field `verification_status` + if (jsonObj.get("verification_status") != null && !jsonObj.get("verification_status").isJsonNull()) { + DomainVerificationStatus.validateJsonElement(jsonObj.get("verification_status")); + } + if (jsonObj.get("check_results") != null && !jsonObj.get("check_results").isJsonNull()) { + JsonArray jsonArraycheckResults = jsonObj.getAsJsonArray("check_results"); + if (jsonArraycheckResults != null) { + // ensure the json data is an array + if (!jsonObj.get("check_results").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `check_results` to be an array in the JSON string but got `%s`", jsonObj.get("check_results").toString())); + } + + // validate the optional field `check_results` (array) + for (int i = 0; i < jsonArraycheckResults.size(); i++) { + DomainCheckResult.validateJsonElement(jsonArraycheckResults.get(i)); + }; } - - // validate the optional field `check_results` (array) - for (int i = 0; i < jsonArraycheckResults.size(); i++) { - DomainCheckResult.validateJsonObject(jsonArraycheckResults.get(i).getAsJsonObject()); - }; } } @@ -458,71 +410,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SSODomainConfig value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SSODomainConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SSODomainConfig instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SSODomainConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of SSODomainConfig - * @throws IOException if the JSON string is invalid with respect to SSODomainConfig - */ + /** + * Create an instance of SSODomainConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSODomainConfig + * @throws IOException if the JSON string is invalid with respect to SSODomainConfig + */ public static SSODomainConfig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SSODomainConfig.class); } - /** - * Convert an instance of SSODomainConfig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SSODomainConfig 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/model/SSODomainConfigResponse.java b/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponse.java index b5d3723..f4dc407 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponse.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponse.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.SSODomainConfig; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,18 +52,16 @@ /** * The response to a request for the list of domain claims associated with a particular organization. */ -@ApiModel(description = "The response to a request for the list of domain claims associated with a particular organization. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SSODomainConfigResponse { public static final String SERIALIZED_NAME_DOMAIN_CONFIGS = "domain_configs"; @SerializedName(SERIALIZED_NAME_DOMAIN_CONFIGS) - private List domainConfigs = null; + private List domainConfigs = new ArrayList<>(); - public SSODomainConfigResponse() { + public SSODomainConfigResponse() { } public SSODomainConfigResponse domainConfigs(List domainConfigs) { - this.domainConfigs = domainConfigs; return this; } @@ -68,57 +74,19 @@ public SSODomainConfigResponse addDomainConfigsItem(SSODomainConfig domainConfig return this; } - /** + /** * Get domainConfigs * @return domainConfigs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getDomainConfigs() { return domainConfigs; } - public void setDomainConfigs(List domainConfigs) { this.domainConfigs = domainConfigs; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SSODomainConfigResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -130,13 +98,12 @@ public boolean equals(Object o) { return false; } SSODomainConfigResponse ssODomainConfigResponse = (SSODomainConfigResponse) o; - return Objects.equals(this.domainConfigs, ssODomainConfigResponse.domainConfigs)&& - Objects.equals(this.additionalProperties, ssODomainConfigResponse.additionalProperties); + return Objects.equals(this.domainConfigs, ssODomainConfigResponse.domainConfigs); } @Override public int hashCode() { - return Objects.hash(domainConfigs, additionalProperties); + return Objects.hash(domainConfigs); } @Override @@ -144,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SSODomainConfigResponse {\n"); sb.append(" domainConfigs: ").append(toIndentedString(domainConfigs)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -173,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SSODomainConfigResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SSODomainConfigResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SSODomainConfigResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SSODomainConfigResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SSODomainConfigResponse is not found in the empty JSON string", SSODomainConfigResponse.openapiRequiredFields.toString())); } } - JsonArray jsonArraydomainConfigs = jsonObj.getAsJsonArray("domain_configs"); - if (jsonArraydomainConfigs != null) { - // ensure the json data is an array - if (!jsonObj.get("domain_configs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `domain_configs` to be an array in the JSON string but got `%s`", jsonObj.get("domain_configs").toString())); - } - // validate the optional field `domain_configs` (array) - for (int i = 0; i < jsonArraydomainConfigs.size(); i++) { - SSODomainConfig.validateJsonObject(jsonArraydomainConfigs.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SSODomainConfigResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SSODomainConfigResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("domain_configs") != null && !jsonObj.get("domain_configs").isJsonNull()) { + JsonArray jsonArraydomainConfigs = jsonObj.getAsJsonArray("domain_configs"); + if (jsonArraydomainConfigs != null) { + // ensure the json data is an array + if (!jsonObj.get("domain_configs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `domain_configs` to be an array in the JSON string but got `%s`", jsonObj.get("domain_configs").toString())); + } + + // validate the optional field `domain_configs` (array) + for (int i = 0; i < jsonArraydomainConfigs.size(); i++) { + SSODomainConfig.validateJsonElement(jsonArraydomainConfigs.get(i)); + }; + } } } @@ -216,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SSODomainConfigResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SSODomainConfigResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SSODomainConfigResponse instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SSODomainConfigResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of SSODomainConfigResponse - * @throws IOException if the JSON string is invalid with respect to SSODomainConfigResponse - */ + /** + * Create an instance of SSODomainConfigResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSODomainConfigResponse + * @throws IOException if the JSON string is invalid with respect to SSODomainConfigResponse + */ public static SSODomainConfigResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SSODomainConfigResponse.class); } - /** - * Convert an instance of SSODomainConfigResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SSODomainConfigResponse 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/model/SSODomainSetup.java b/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainSetup.java index 9db95ea..1e914f5 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainSetup.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SSODomainSetup.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Configuration settings to verify ownership of a given domain. At least one of these must be completed enable user login from the domain. */ -@ApiModel(description = "Configuration settings to verify ownership of a given domain. At least one of these must be completed enable user login from the domain. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SSODomainSetup { public static final String SERIALIZED_NAME_TXT = "txt"; @SerializedName(SERIALIZED_NAME_TXT) @@ -56,112 +63,65 @@ public class SSODomainSetup { @SerializedName(SERIALIZED_NAME_CNAME_DST) private String cnameDst; - public SSODomainSetup() { + public SSODomainSetup() { } public SSODomainSetup txt(String txt) { - this.txt = txt; return this; } - /** + /** * a DNS TXT record to set on the domain to claim. * @return txt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "a DNS TXT record to set on the domain to claim.") - public String getTxt() { return txt; } - public void setTxt(String txt) { this.txt = txt; } public SSODomainSetup cnameSrc(String cnameSrc) { - this.cnameSrc = cnameSrc; return this; } - /** + /** * a DNS name to set a CNAME record on * @return cnameSrc - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "a DNS name to set a CNAME record on") - public String getCnameSrc() { return cnameSrc; } - public void setCnameSrc(String cnameSrc) { this.cnameSrc = cnameSrc; } public SSODomainSetup cnameDst(String cnameDst) { - this.cnameDst = cnameDst; return this; } - /** + /** * the CNAME target of `cname_src`. * @return cnameDst - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the CNAME target of `cname_src`.") - public String getCnameDst() { return cnameDst; } - public void setCnameDst(String cnameDst) { this.cnameDst = cnameDst; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SSODomainSetup putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { SSODomainSetup ssODomainSetup = (SSODomainSetup) o; return Objects.equals(this.txt, ssODomainSetup.txt) && Objects.equals(this.cnameSrc, ssODomainSetup.cnameSrc) && - Objects.equals(this.cnameDst, ssODomainSetup.cnameDst)&& - Objects.equals(this.additionalProperties, ssODomainSetup.additionalProperties); + Objects.equals(this.cnameDst, ssODomainSetup.cnameDst); } @Override public int hashCode() { - return Objects.hash(txt, cnameSrc, cnameDst, additionalProperties); + return Objects.hash(txt, cnameSrc, cnameDst); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" txt: ").append(toIndentedString(txt)).append("\n"); sb.append(" cnameSrc: ").append(toIndentedString(cnameSrc)).append("\n"); sb.append(" cnameDst: ").append(toIndentedString(cnameDst)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SSODomainSetup - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SSODomainSetup.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SSODomainSetup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SSODomainSetup.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SSODomainSetup is not found in the empty JSON string", SSODomainSetup.openapiRequiredFields.toString())); } } - if (jsonObj.get("txt") != null && !jsonObj.get("txt").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SSODomainSetup.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SSODomainSetup` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("txt") != null && !jsonObj.get("txt").isJsonNull()) && !jsonObj.get("txt").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `txt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txt").toString())); } - if (jsonObj.get("cname_src") != null && !jsonObj.get("cname_src").isJsonPrimitive()) { + if ((jsonObj.get("cname_src") != null && !jsonObj.get("cname_src").isJsonNull()) && !jsonObj.get("cname_src").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cname_src` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cname_src").toString())); } - if (jsonObj.get("cname_dst") != null && !jsonObj.get("cname_dst").isJsonPrimitive()) { + if ((jsonObj.get("cname_dst") != null && !jsonObj.get("cname_dst").isJsonNull()) && !jsonObj.get("cname_dst").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cname_dst` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cname_dst").toString())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SSODomainSetup value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SSODomainSetup read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SSODomainSetup instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SSODomainSetup given an JSON string - * - * @param jsonString JSON string - * @return An instance of SSODomainSetup - * @throws IOException if the JSON string is invalid with respect to SSODomainSetup - */ + /** + * Create an instance of SSODomainSetup given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSODomainSetup + * @throws IOException if the JSON string is invalid with respect to SSODomainSetup + */ public static SSODomainSetup fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SSODomainSetup.class); } - /** - * Convert an instance of SSODomainSetup to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SSODomainSetup 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/model/SSOProvider.java b/src/main/java/io/tiledb/cloud/rest_api/model/SSOProvider.java index 9a07e4e..c71a9aa 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SSOProvider.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SSOProvider.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -76,5 +77,10 @@ public SSOProvider read(final JsonReader jsonReader) throws IOException { return SSOProvider.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SSOProvider.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/SharePaymentRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/SharePaymentRequest.java index 411de94..f7a04dc 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SharePaymentRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SharePaymentRequest.java @@ -14,27 +14,36 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,17 +51,16 @@ /** * SharePaymentRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SharePaymentRequest { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) - private List namespaces = null; + private List namespaces = new ArrayList<>(); - public SharePaymentRequest() { + public SharePaymentRequest() { } public SharePaymentRequest namespaces(List namespaces) { - this.namespaces = namespaces; return this; } @@ -65,57 +73,19 @@ public SharePaymentRequest addNamespacesItem(String namespacesItem) { return this; } - /** + /** * Get namespaces * @return namespaces - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getNamespaces() { return namespaces; } - public void setNamespaces(List namespaces) { this.namespaces = namespaces; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SharePaymentRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -127,13 +97,12 @@ public boolean equals(Object o) { return false; } SharePaymentRequest sharePaymentRequest = (SharePaymentRequest) o; - return Objects.equals(this.namespaces, sharePaymentRequest.namespaces)&& - Objects.equals(this.additionalProperties, sharePaymentRequest.additionalProperties); + return Objects.equals(this.namespaces, sharePaymentRequest.namespaces); } @Override public int hashCode() { - return Objects.hash(namespaces, additionalProperties); + return Objects.hash(namespaces); } @Override @@ -141,7 +110,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SharePaymentRequest {\n"); sb.append(" namespaces: ").append(toIndentedString(namespaces)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -170,22 +138,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SharePaymentRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SharePaymentRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SharePaymentRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SharePaymentRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SharePaymentRequest is not found in the empty JSON string", SharePaymentRequest.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SharePaymentRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SharePaymentRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("namespaces") != null && !jsonObj.get("namespaces").isJsonNull() && !jsonObj.get("namespaces").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespaces` to be an array in the JSON string but got `%s`", jsonObj.get("namespaces").toString())); } } @@ -205,71 +180,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SharePaymentRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SharePaymentRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SharePaymentRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SharePaymentRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of SharePaymentRequest - * @throws IOException if the JSON string is invalid with respect to SharePaymentRequest - */ + /** + * Create an instance of SharePaymentRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SharePaymentRequest + * @throws IOException if the JSON string is invalid with respect to SharePaymentRequest + */ public static SharePaymentRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SharePaymentRequest.class); } - /** - * Convert an instance of SharePaymentRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SharePaymentRequest 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/model/SingleFragmentInfo.java b/src/main/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfo.java index 7ec5b1e..6260d10 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfo.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfo.java @@ -14,34 +14,43 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.FragmentMetadata; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Single Fragment info of an array */ -@ApiModel(description = "Single Fragment info of an array") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SingleFragmentInfo { public static final String SERIALIZED_NAME_ARRAY_SCHEMA_NAME = "ArraySchemaName"; @SerializedName(SERIALIZED_NAME_ARRAY_SCHEMA_NAME) @@ -51,89 +60,46 @@ public class SingleFragmentInfo { @SerializedName(SERIALIZED_NAME_META) private FragmentMetadata meta; - public SingleFragmentInfo() { + public SingleFragmentInfo() { } public SingleFragmentInfo arraySchemaName(String arraySchemaName) { - this.arraySchemaName = arraySchemaName; return this; } - /** + /** * array schema name * @return arraySchemaName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "array schema name") - public String getArraySchemaName() { return arraySchemaName; } - public void setArraySchemaName(String arraySchemaName) { this.arraySchemaName = arraySchemaName; } public SingleFragmentInfo meta(FragmentMetadata meta) { - this.meta = meta; return this; } - /** + /** * Get meta * @return meta - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public FragmentMetadata getMeta() { return meta; } - public void setMeta(FragmentMetadata meta) { this.meta = meta; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SingleFragmentInfo putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -146,13 +112,12 @@ public boolean equals(Object o) { } SingleFragmentInfo singleFragmentInfo = (SingleFragmentInfo) o; return Objects.equals(this.arraySchemaName, singleFragmentInfo.arraySchemaName) && - Objects.equals(this.meta, singleFragmentInfo.meta)&& - Objects.equals(this.additionalProperties, singleFragmentInfo.additionalProperties); + Objects.equals(this.meta, singleFragmentInfo.meta); } @Override public int hashCode() { - return Objects.hash(arraySchemaName, meta, additionalProperties); + return Objects.hash(arraySchemaName, meta); } @Override @@ -161,7 +126,6 @@ public String toString() { sb.append("class SingleFragmentInfo {\n"); sb.append(" arraySchemaName: ").append(toIndentedString(arraySchemaName)).append("\n"); sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -191,26 +155,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SingleFragmentInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SingleFragmentInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SingleFragmentInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SingleFragmentInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SingleFragmentInfo is not found in the empty JSON string", SingleFragmentInfo.openapiRequiredFields.toString())); } } - if (jsonObj.get("ArraySchemaName") != null && !jsonObj.get("ArraySchemaName").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SingleFragmentInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SingleFragmentInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ArraySchemaName") != null && !jsonObj.get("ArraySchemaName").isJsonNull()) && !jsonObj.get("ArraySchemaName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `ArraySchemaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ArraySchemaName").toString())); } // validate the optional field `meta` - if (jsonObj.getAsJsonObject("meta") != null) { - FragmentMetadata.validateJsonObject(jsonObj.getAsJsonObject("meta")); + if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { + FragmentMetadata.validateJsonElement(jsonObj.get("meta")); } } @@ -229,71 +200,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SingleFragmentInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SingleFragmentInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SingleFragmentInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SingleFragmentInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of SingleFragmentInfo - * @throws IOException if the JSON string is invalid with respect to SingleFragmentInfo - */ + /** + * Create an instance of SingleFragmentInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of SingleFragmentInfo + * @throws IOException if the JSON string is invalid with respect to SingleFragmentInfo + */ public static SingleFragmentInfo fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SingleFragmentInfo.class); } - /** - * Convert an instance of SingleFragmentInfo to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SingleFragmentInfo 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/model/StorageLocation.java b/src/main/java/io/tiledb/cloud/rest_api/model/StorageLocation.java index 30a007c..4d62a25 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/StorageLocation.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/StorageLocation.java @@ -14,27 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +50,7 @@ /** * The path at which a given asset will be stored, and the credentials used to access that asset. */ -@ApiModel(description = "The path at which a given asset will be stored, and the credentials used to access that asset. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class StorageLocation { public static final String SERIALIZED_NAME_PATH = "path"; @SerializedName(SERIALIZED_NAME_PATH) @@ -53,89 +60,46 @@ public class StorageLocation { @SerializedName(SERIALIZED_NAME_CREDENTIALS_NAME) private String credentialsName; - public StorageLocation() { + public StorageLocation() { } public StorageLocation path(String path) { - this.path = path; return this; } - /** + /** * The path to store this asset type. If unset, a suffix of the user's `default_s3_path` is used. When updating, explicitly set to `\"\"`, the empty string, to clear this path; leaving it `null` (or absent) will leave the path unchanged. * @return path - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The path to store this asset type. If unset, a suffix of the user's `default_s3_path` is used. When updating, explicitly set to `\"\"`, the empty string, to clear this path; leaving it `null` (or absent) will leave the path unchanged. ") - public String getPath() { return path; } - public void setPath(String path) { this.path = path; } public StorageLocation credentialsName(String credentialsName) { - this.credentialsName = credentialsName; return this; } - /** + /** * The name of the credentials used to acess this storage path. If unset, the `default_s3_path_credentials_name` is used. When updating, explicitly set to `\"\"`, the empty string, to clear this name; leaving it `null` (or absent) will leave the name unchanged. * @return credentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the credentials used to acess this storage path. If unset, the `default_s3_path_credentials_name` is used. When updating, explicitly set to `\"\"`, the empty string, to clear this name; leaving it `null` (or absent) will leave the name unchanged. ") - public String getCredentialsName() { return credentialsName; } - public void setCredentialsName(String credentialsName) { this.credentialsName = credentialsName; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public StorageLocation putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -148,8 +112,7 @@ public boolean equals(Object o) { } StorageLocation storageLocation = (StorageLocation) o; return Objects.equals(this.path, storageLocation.path) && - Objects.equals(this.credentialsName, storageLocation.credentialsName)&& - Objects.equals(this.additionalProperties, storageLocation.additionalProperties); + Objects.equals(this.credentialsName, storageLocation.credentialsName); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -158,7 +121,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(path, credentialsName, additionalProperties); + return Objects.hash(path, credentialsName); } private static int hashCodeNullable(JsonNullable a) { @@ -174,7 +137,6 @@ public String toString() { sb.append("class StorageLocation {\n"); sb.append(" path: ").append(toIndentedString(path)).append("\n"); sb.append(" credentialsName: ").append(toIndentedString(credentialsName)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,24 +166,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to StorageLocation - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (StorageLocation.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 StorageLocation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StorageLocation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in StorageLocation is not found in the empty JSON string", StorageLocation.openapiRequiredFields.toString())); } } - if (jsonObj.get("path") != null && !jsonObj.get("path").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StorageLocation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StorageLocation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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").isJsonPrimitive()) { + 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())); } } @@ -241,71 +210,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, StorageLocation value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public StorageLocation read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - StorageLocation instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of StorageLocation given an JSON string - * - * @param jsonString JSON string - * @return An instance of StorageLocation - * @throws IOException if the JSON string is invalid with respect to StorageLocation - */ + /** + * Create an instance of StorageLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageLocation + * @throws IOException if the JSON string is invalid with respect to StorageLocation + */ public static StorageLocation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StorageLocation.class); } - /** - * Convert an instance of StorageLocation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StorageLocation 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/model/Subarray.java b/src/main/java/io/tiledb/cloud/rest_api/model/Subarray.java index abe058d..2df4e24 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Subarray.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Subarray.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Layout; +import io.tiledb.cloud.rest_api.model.SubarrayRanges; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +53,7 @@ /** * A Subarray */ -@ApiModel(description = "A Subarray") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Subarray { public static final String SERIALIZED_NAME_LAYOUT = "layout"; @SerializedName(SERIALIZED_NAME_LAYOUT) @@ -53,36 +61,31 @@ public class Subarray { public static final String SERIALIZED_NAME_RANGES = "ranges"; @SerializedName(SERIALIZED_NAME_RANGES) - private List ranges = null; + private List ranges = new ArrayList<>(); - public Subarray() { + public Subarray() { } public Subarray layout(Layout layout) { - this.layout = layout; return this; } - /** + /** * Get layout * @return layout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Layout getLayout() { return layout; } - public void setLayout(Layout layout) { this.layout = layout; } public Subarray ranges(List ranges) { - this.ranges = ranges; return this; } @@ -95,57 +98,19 @@ public Subarray addRangesItem(SubarrayRanges rangesItem) { return this; } - /** + /** * List of 1D ranges, one per dimension * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of 1D ranges, one per dimension") - public List getRanges() { return ranges; } - public void setRanges(List ranges) { this.ranges = ranges; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Subarray putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } Subarray subarray = (Subarray) o; return Objects.equals(this.layout, subarray.layout) && - Objects.equals(this.ranges, subarray.ranges)&& - Objects.equals(this.additionalProperties, subarray.additionalProperties); + Objects.equals(this.ranges, subarray.ranges); } @Override public int hashCode() { - return Objects.hash(layout, ranges, additionalProperties); + return Objects.hash(layout, ranges); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class Subarray {\n"); sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,31 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Subarray - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Subarray.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Subarray + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Subarray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Subarray is not found in the empty JSON string", Subarray.openapiRequiredFields.toString())); } } - JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); - if (jsonArrayranges != null) { - // ensure the json data is an array - if (!jsonObj.get("ranges").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); - } - // validate the optional field `ranges` (array) - for (int i = 0; i < jsonArrayranges.size(); i++) { - SubarrayRanges.validateJsonObject(jsonArrayranges.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Subarray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Subarray` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `layout` + if (jsonObj.get("layout") != null && !jsonObj.get("layout").isJsonNull()) { + Layout.validateJsonElement(jsonObj.get("layout")); + } + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull()) { + JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); + if (jsonArrayranges != null) { + // ensure the json data is an array + if (!jsonObj.get("ranges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); + } + + // validate the optional field `ranges` (array) + for (int i = 0; i < jsonArrayranges.size(); i++) { + SubarrayRanges.validateJsonElement(jsonArrayranges.get(i)); + }; + } } } @@ -246,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Subarray value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Subarray read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Subarray instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Subarray given an JSON string - * - * @param jsonString JSON string - * @return An instance of Subarray - * @throws IOException if the JSON string is invalid with respect to Subarray - */ + /** + * Create an instance of Subarray given an JSON string + * + * @param jsonString JSON string + * @return An instance of Subarray + * @throws IOException if the JSON string is invalid with respect to Subarray + */ public static Subarray fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Subarray.class); } - /** - * Convert an instance of Subarray to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Subarray 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/model/SubarrayPartitioner.java b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitioner.java index f4aae13..1dcf77f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitioner.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitioner.java @@ -14,29 +14,40 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AttributeBufferSize; +import io.tiledb.cloud.rest_api.model.Subarray; +import io.tiledb.cloud.rest_api.model.SubarrayPartitionerCurrent; +import io.tiledb.cloud.rest_api.model.SubarrayPartitionerState; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +55,7 @@ /** * The subarray partitioner */ -@ApiModel(description = "The subarray partitioner") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SubarrayPartitioner { public static final String SERIALIZED_NAME_SUBARRAY = "subarray"; @SerializedName(SERIALIZED_NAME_SUBARRAY) @@ -53,7 +63,7 @@ public class SubarrayPartitioner { public static final String SERIALIZED_NAME_BUDGET = "budget"; @SerializedName(SERIALIZED_NAME_BUDGET) - private List budget = null; + private List budget = new ArrayList<>(); public static final String SERIALIZED_NAME_CURRENT = "current"; @SerializedName(SERIALIZED_NAME_CURRENT) @@ -71,34 +81,29 @@ public class SubarrayPartitioner { @SerializedName(SERIALIZED_NAME_MEMORY_BUDGET_VAR) private Integer memoryBudgetVar; - public SubarrayPartitioner() { + public SubarrayPartitioner() { } public SubarrayPartitioner subarray(Subarray subarray) { - this.subarray = subarray; return this; } - /** + /** * Get subarray * @return subarray - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Subarray getSubarray() { return subarray; } - public void setSubarray(Subarray subarray) { this.subarray = subarray; } public SubarrayPartitioner budget(List budget) { - this.budget = budget; return this; } @@ -111,149 +116,95 @@ public SubarrayPartitioner addBudgetItem(AttributeBufferSize budgetItem) { return this; } - /** + /** * Result size budget (in bytes) for all attributes. * @return budget - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Result size budget (in bytes) for all attributes.") - public List getBudget() { return budget; } - public void setBudget(List budget) { this.budget = budget; } public SubarrayPartitioner current(SubarrayPartitionerCurrent current) { - this.current = current; return this; } - /** + /** * Get current * @return current - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public SubarrayPartitionerCurrent getCurrent() { return current; } - public void setCurrent(SubarrayPartitionerCurrent current) { this.current = current; } public SubarrayPartitioner state(SubarrayPartitionerState state) { - this.state = state; return this; } - /** + /** * Get state * @return state - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public SubarrayPartitionerState getState() { return state; } - public void setState(SubarrayPartitionerState state) { this.state = state; } public SubarrayPartitioner memoryBudget(Integer memoryBudget) { - this.memoryBudget = memoryBudget; return this; } - /** + /** * The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes * @return memoryBudget - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes") - public Integer getMemoryBudget() { return memoryBudget; } - public void setMemoryBudget(Integer memoryBudget) { this.memoryBudget = memoryBudget; } public SubarrayPartitioner memoryBudgetVar(Integer memoryBudgetVar) { - this.memoryBudgetVar = memoryBudgetVar; return this; } - /** + /** * The memory budget for the var-sized attributes * @return memoryBudgetVar - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The memory budget for the var-sized attributes") - public Integer getMemoryBudgetVar() { return memoryBudgetVar; } - public void setMemoryBudgetVar(Integer memoryBudgetVar) { this.memoryBudgetVar = memoryBudgetVar; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SubarrayPartitioner putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -270,13 +221,12 @@ public boolean equals(Object o) { Objects.equals(this.current, subarrayPartitioner.current) && Objects.equals(this.state, subarrayPartitioner.state) && Objects.equals(this.memoryBudget, subarrayPartitioner.memoryBudget) && - Objects.equals(this.memoryBudgetVar, subarrayPartitioner.memoryBudgetVar)&& - Objects.equals(this.additionalProperties, subarrayPartitioner.additionalProperties); + Objects.equals(this.memoryBudgetVar, subarrayPartitioner.memoryBudgetVar); } @Override public int hashCode() { - return Objects.hash(subarray, budget, current, state, memoryBudget, memoryBudgetVar, additionalProperties); + return Objects.hash(subarray, budget, current, state, memoryBudget, memoryBudgetVar); } @Override @@ -289,7 +239,6 @@ public String toString() { sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" memoryBudget: ").append(toIndentedString(memoryBudget)).append("\n"); sb.append(" memoryBudgetVar: ").append(toIndentedString(memoryBudgetVar)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -323,43 +272,52 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SubarrayPartitioner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SubarrayPartitioner.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SubarrayPartitioner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubarrayPartitioner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayPartitioner is not found in the empty JSON string", SubarrayPartitioner.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubarrayPartitioner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubarrayPartitioner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `subarray` - if (jsonObj.getAsJsonObject("subarray") != null) { - Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + if (jsonObj.get("subarray") != null && !jsonObj.get("subarray").isJsonNull()) { + Subarray.validateJsonElement(jsonObj.get("subarray")); } - JsonArray jsonArraybudget = jsonObj.getAsJsonArray("budget"); - if (jsonArraybudget != null) { - // ensure the json data is an array - if (!jsonObj.get("budget").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `budget` to be an array in the JSON string but got `%s`", jsonObj.get("budget").toString())); + if (jsonObj.get("budget") != null && !jsonObj.get("budget").isJsonNull()) { + JsonArray jsonArraybudget = jsonObj.getAsJsonArray("budget"); + if (jsonArraybudget != null) { + // ensure the json data is an array + if (!jsonObj.get("budget").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `budget` to be an array in the JSON string but got `%s`", jsonObj.get("budget").toString())); + } + + // validate the optional field `budget` (array) + for (int i = 0; i < jsonArraybudget.size(); i++) { + AttributeBufferSize.validateJsonElement(jsonArraybudget.get(i)); + }; } - - // validate the optional field `budget` (array) - for (int i = 0; i < jsonArraybudget.size(); i++) { - AttributeBufferSize.validateJsonObject(jsonArraybudget.get(i).getAsJsonObject()); - }; } // validate the optional field `current` - if (jsonObj.getAsJsonObject("current") != null) { - SubarrayPartitionerCurrent.validateJsonObject(jsonObj.getAsJsonObject("current")); + if (jsonObj.get("current") != null && !jsonObj.get("current").isJsonNull()) { + SubarrayPartitionerCurrent.validateJsonElement(jsonObj.get("current")); } // validate the optional field `state` - if (jsonObj.getAsJsonObject("state") != null) { - SubarrayPartitionerState.validateJsonObject(jsonObj.getAsJsonObject("state")); + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) { + SubarrayPartitionerState.validateJsonElement(jsonObj.get("state")); } } @@ -378,71 +336,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SubarrayPartitioner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SubarrayPartitioner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SubarrayPartitioner instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SubarrayPartitioner given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubarrayPartitioner - * @throws IOException if the JSON string is invalid with respect to SubarrayPartitioner - */ + /** + * Create an instance of SubarrayPartitioner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayPartitioner + * @throws IOException if the JSON string is invalid with respect to SubarrayPartitioner + */ public static SubarrayPartitioner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SubarrayPartitioner.class); } - /** - * Convert an instance of SubarrayPartitioner to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SubarrayPartitioner 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/model/SubarrayPartitionerCurrent.java b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrent.java index 1d9940c..e2c9c46 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrent.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrent.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Subarray; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * The current partition info */ -@ApiModel(description = "The current partition info") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SubarrayPartitionerCurrent { public static final String SERIALIZED_NAME_SUBARRAY = "subarray"; @SerializedName(SERIALIZED_NAME_SUBARRAY) @@ -60,135 +68,84 @@ public class SubarrayPartitionerCurrent { @SerializedName(SERIALIZED_NAME_SPLIT_MULTI_RANGE) private Boolean splitMultiRange; - public SubarrayPartitionerCurrent() { + public SubarrayPartitionerCurrent() { } public SubarrayPartitionerCurrent subarray(Subarray subarray) { - this.subarray = subarray; return this; } - /** + /** * Get subarray * @return subarray - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Subarray getSubarray() { return subarray; } - public void setSubarray(Subarray subarray) { this.subarray = subarray; } public SubarrayPartitionerCurrent start(Integer start) { - this.start = start; return this; } - /** + /** * PartitionInfo start * @return start - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "PartitionInfo start") - public Integer getStart() { return start; } - public void setStart(Integer start) { this.start = start; } public SubarrayPartitionerCurrent end(Integer end) { - this.end = end; return this; } - /** + /** * PartitionInfo end * @return end - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "PartitionInfo end") - public Integer getEnd() { return end; } - public void setEnd(Integer end) { this.end = end; } public SubarrayPartitionerCurrent splitMultiRange(Boolean splitMultiRange) { - this.splitMultiRange = splitMultiRange; return this; } - /** + /** * PartitionInfo splitMultiRange * @return splitMultiRange - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "PartitionInfo splitMultiRange") - public Boolean getSplitMultiRange() { return splitMultiRange; } - public void setSplitMultiRange(Boolean splitMultiRange) { this.splitMultiRange = splitMultiRange; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SubarrayPartitionerCurrent putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +160,12 @@ public boolean equals(Object o) { return Objects.equals(this.subarray, subarrayPartitionerCurrent.subarray) && Objects.equals(this.start, subarrayPartitionerCurrent.start) && Objects.equals(this.end, subarrayPartitionerCurrent.end) && - Objects.equals(this.splitMultiRange, subarrayPartitionerCurrent.splitMultiRange)&& - Objects.equals(this.additionalProperties, subarrayPartitionerCurrent.additionalProperties); + Objects.equals(this.splitMultiRange, subarrayPartitionerCurrent.splitMultiRange); } @Override public int hashCode() { - return Objects.hash(subarray, start, end, splitMultiRange, additionalProperties); + return Objects.hash(subarray, start, end, splitMultiRange); } @Override @@ -220,7 +176,6 @@ public String toString() { sb.append(" start: ").append(toIndentedString(start)).append("\n"); sb.append(" end: ").append(toIndentedString(end)).append("\n"); sb.append(" splitMultiRange: ").append(toIndentedString(splitMultiRange)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -252,23 +207,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SubarrayPartitionerCurrent - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SubarrayPartitionerCurrent.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SubarrayPartitionerCurrent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubarrayPartitionerCurrent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayPartitionerCurrent is not found in the empty JSON string", SubarrayPartitionerCurrent.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubarrayPartitionerCurrent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubarrayPartitionerCurrent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `subarray` - if (jsonObj.getAsJsonObject("subarray") != null) { - Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + if (jsonObj.get("subarray") != null && !jsonObj.get("subarray").isJsonNull()) { + Subarray.validateJsonElement(jsonObj.get("subarray")); } } @@ -287,71 +249,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SubarrayPartitionerCurrent value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SubarrayPartitionerCurrent read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SubarrayPartitionerCurrent instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SubarrayPartitionerCurrent given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubarrayPartitionerCurrent - * @throws IOException if the JSON string is invalid with respect to SubarrayPartitionerCurrent - */ + /** + * Create an instance of SubarrayPartitionerCurrent given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayPartitionerCurrent + * @throws IOException if the JSON string is invalid with respect to SubarrayPartitionerCurrent + */ public static SubarrayPartitionerCurrent fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SubarrayPartitionerCurrent.class); } - /** - * Convert an instance of SubarrayPartitionerCurrent to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SubarrayPartitionerCurrent 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/model/SubarrayPartitionerState.java b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerState.java index 1ce309d..76777ac 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerState.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerState.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Subarray; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +52,7 @@ /** * The state information for the remaining partitions to be produced */ -@ApiModel(description = "The state information for the remaining partitions to be produced") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SubarrayPartitionerState { public static final String SERIALIZED_NAME_START = "start"; @SerializedName(SERIALIZED_NAME_START) @@ -57,63 +64,54 @@ public class SubarrayPartitionerState { public static final String SERIALIZED_NAME_SINGLE_RANGE = "singleRange"; @SerializedName(SERIALIZED_NAME_SINGLE_RANGE) - private List singleRange = null; + private List singleRange = new ArrayList<>(); public static final String SERIALIZED_NAME_MULTI_RANGE = "multiRange"; @SerializedName(SERIALIZED_NAME_MULTI_RANGE) - private List multiRange = null; + private List multiRange = new ArrayList<>(); - public SubarrayPartitionerState() { + public SubarrayPartitionerState() { } public SubarrayPartitionerState start(Integer start) { - this.start = start; return this; } - /** + /** * State start * @return start - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "State start") - public Integer getStart() { return start; } - public void setStart(Integer start) { this.start = start; } public SubarrayPartitionerState end(Integer end) { - this.end = end; return this; } - /** + /** * State end * @return end - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "State end") - public Integer getEnd() { return end; } - public void setEnd(Integer end) { this.end = end; } public SubarrayPartitionerState singleRange(List singleRange) { - this.singleRange = singleRange; return this; } @@ -126,25 +124,21 @@ public SubarrayPartitionerState addSingleRangeItem(Subarray singleRangeItem) { return this; } - /** + /** * State singleRange * @return singleRange - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "State singleRange") - public List getSingleRange() { return singleRange; } - public void setSingleRange(List singleRange) { this.singleRange = singleRange; } public SubarrayPartitionerState multiRange(List multiRange) { - this.multiRange = multiRange; return this; } @@ -157,57 +151,19 @@ public SubarrayPartitionerState addMultiRangeItem(Subarray multiRangeItem) { return this; } - /** + /** * State multiRange * @return multiRange - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "State multiRange") - public List getMultiRange() { return multiRange; } - public void setMultiRange(List multiRange) { this.multiRange = multiRange; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SubarrayPartitionerState putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -222,13 +178,12 @@ public boolean equals(Object o) { return Objects.equals(this.start, subarrayPartitionerState.start) && Objects.equals(this.end, subarrayPartitionerState.end) && Objects.equals(this.singleRange, subarrayPartitionerState.singleRange) && - Objects.equals(this.multiRange, subarrayPartitionerState.multiRange)&& - Objects.equals(this.additionalProperties, subarrayPartitionerState.additionalProperties); + Objects.equals(this.multiRange, subarrayPartitionerState.multiRange); } @Override public int hashCode() { - return Objects.hash(start, end, singleRange, multiRange, additionalProperties); + return Objects.hash(start, end, singleRange, multiRange); } @Override @@ -239,7 +194,6 @@ public String toString() { sb.append(" end: ").append(toIndentedString(end)).append("\n"); sb.append(" singleRange: ").append(toIndentedString(singleRange)).append("\n"); sb.append(" multiRange: ").append(toIndentedString(multiRange)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -271,43 +225,54 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SubarrayPartitionerState - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SubarrayPartitionerState.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SubarrayPartitionerState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubarrayPartitionerState.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayPartitionerState is not found in the empty JSON string", SubarrayPartitionerState.openapiRequiredFields.toString())); } } - JsonArray jsonArraysingleRange = jsonObj.getAsJsonArray("singleRange"); - if (jsonArraysingleRange != null) { - // ensure the json data is an array - if (!jsonObj.get("singleRange").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `singleRange` to be an array in the JSON string but got `%s`", jsonObj.get("singleRange").toString())); - } - // validate the optional field `singleRange` (array) - for (int i = 0; i < jsonArraysingleRange.size(); i++) { - Subarray.validateJsonObject(jsonArraysingleRange.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubarrayPartitionerState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubarrayPartitionerState` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } } - JsonArray jsonArraymultiRange = jsonObj.getAsJsonArray("multiRange"); - if (jsonArraymultiRange != null) { - // ensure the json data is an array - if (!jsonObj.get("multiRange").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `multiRange` to be an array in the JSON string but got `%s`", jsonObj.get("multiRange").toString())); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("singleRange") != null && !jsonObj.get("singleRange").isJsonNull()) { + JsonArray jsonArraysingleRange = jsonObj.getAsJsonArray("singleRange"); + if (jsonArraysingleRange != null) { + // ensure the json data is an array + if (!jsonObj.get("singleRange").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `singleRange` to be an array in the JSON string but got `%s`", jsonObj.get("singleRange").toString())); + } + + // validate the optional field `singleRange` (array) + for (int i = 0; i < jsonArraysingleRange.size(); i++) { + Subarray.validateJsonElement(jsonArraysingleRange.get(i)); + }; + } + } + if (jsonObj.get("multiRange") != null && !jsonObj.get("multiRange").isJsonNull()) { + JsonArray jsonArraymultiRange = jsonObj.getAsJsonArray("multiRange"); + if (jsonArraymultiRange != null) { + // ensure the json data is an array + if (!jsonObj.get("multiRange").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `multiRange` to be an array in the JSON string but got `%s`", jsonObj.get("multiRange").toString())); + } + + // validate the optional field `multiRange` (array) + for (int i = 0; i < jsonArraymultiRange.size(); i++) { + Subarray.validateJsonElement(jsonArraymultiRange.get(i)); + }; } - - // validate the optional field `multiRange` (array) - for (int i = 0; i < jsonArraymultiRange.size(); i++) { - Subarray.validateJsonObject(jsonArraymultiRange.get(i).getAsJsonObject()); - }; } } @@ -326,71 +291,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SubarrayPartitionerState value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SubarrayPartitionerState read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SubarrayPartitionerState instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SubarrayPartitionerState given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubarrayPartitionerState - * @throws IOException if the JSON string is invalid with respect to SubarrayPartitionerState - */ + /** + * Create an instance of SubarrayPartitionerState given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayPartitionerState + * @throws IOException if the JSON string is invalid with respect to SubarrayPartitionerState + */ public static SubarrayPartitionerState fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SubarrayPartitionerState.class); } - /** - * Convert an instance of SubarrayPartitionerState to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SubarrayPartitionerState 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/model/SubarrayRanges.java b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayRanges.java index 25cd96c..74090f4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayRanges.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/SubarrayRanges.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Datatype; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +52,7 @@ /** * A set of 1D ranges for a subarray */ -@ApiModel(description = "A set of 1D ranges for a subarray") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SubarrayRanges { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -56,59 +64,50 @@ public class SubarrayRanges { public static final String SERIALIZED_NAME_BUFFER = "buffer"; @SerializedName(SERIALIZED_NAME_BUFFER) - private List buffer = null; + private List buffer = new ArrayList<>(); - public SubarrayRanges() { + public SubarrayRanges() { } public SubarrayRanges type(Datatype type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Datatype getType() { return type; } - public void setType(Datatype type) { this.type = type; } public SubarrayRanges hasDefaultRange(Boolean hasDefaultRange) { - this.hasDefaultRange = hasDefaultRange; return this; } - /** + /** * True if the range is the default range * @return hasDefaultRange - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if the range is the default range") - public Boolean getHasDefaultRange() { return hasDefaultRange; } - public void setHasDefaultRange(Boolean hasDefaultRange) { this.hasDefaultRange = hasDefaultRange; } public SubarrayRanges buffer(List buffer) { - this.buffer = buffer; return this; } @@ -121,57 +120,19 @@ public SubarrayRanges addBufferItem(Integer bufferItem) { return this; } - /** + /** * The bytes of the ranges * @return buffer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The bytes of the ranges") - public List getBuffer() { return buffer; } - public void setBuffer(List buffer) { this.buffer = buffer; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public SubarrayRanges putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -185,13 +146,12 @@ public boolean equals(Object o) { SubarrayRanges subarrayRanges = (SubarrayRanges) o; return Objects.equals(this.type, subarrayRanges.type) && Objects.equals(this.hasDefaultRange, subarrayRanges.hasDefaultRange) && - Objects.equals(this.buffer, subarrayRanges.buffer)&& - Objects.equals(this.additionalProperties, subarrayRanges.additionalProperties); + Objects.equals(this.buffer, subarrayRanges.buffer); } @Override public int hashCode() { - return Objects.hash(type, hasDefaultRange, buffer, additionalProperties); + return Objects.hash(type, hasDefaultRange, buffer); } @Override @@ -201,7 +161,6 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" hasDefaultRange: ").append(toIndentedString(hasDefaultRange)).append("\n"); sb.append(" buffer: ").append(toIndentedString(buffer)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -232,22 +191,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to SubarrayRanges - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (SubarrayRanges.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 SubarrayRanges + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubarrayRanges.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayRanges is not found in the empty JSON string", SubarrayRanges.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("buffer") != null && !jsonObj.get("buffer").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubarrayRanges.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubarrayRanges` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + Datatype.validateJsonElement(jsonObj.get("type")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("buffer") != null && !jsonObj.get("buffer").isJsonNull() && !jsonObj.get("buffer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `buffer` to be an array in the JSON string but got `%s`", jsonObj.get("buffer").toString())); } } @@ -267,71 +237,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SubarrayRanges value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public SubarrayRanges read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - SubarrayRanges instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of SubarrayRanges given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubarrayRanges - * @throws IOException if the JSON string is invalid with respect to SubarrayRanges - */ + /** + * Create an instance of SubarrayRanges given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayRanges + * @throws IOException if the JSON string is invalid with respect to SubarrayRanges + */ public static SubarrayRanges fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SubarrayRanges.class); } - /** - * Convert an instance of SubarrayRanges to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SubarrayRanges 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/model/Subscription.java b/src/main/java/io/tiledb/cloud/rest_api/model/Subscription.java index e5ce381..ae50ba5 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Subscription.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Subscription.java @@ -14,37 +14,45 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Pricing; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Subscription of a user (customer) to another user's arrays */ -@ApiModel(description = "Subscription of a user (customer) to another user's arrays") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Subscription { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,82 +68,69 @@ public class Subscription { public static final String SERIALIZED_NAME_PRICING = "pricing"; @SerializedName(SERIALIZED_NAME_PRICING) - private List pricing = null; + private List pricing = new ArrayList<>(); - public Subscription() { + public Subscription() { } public Subscription id(String id) { - this.id = id; return this; } - /** + /** * Unique ID of subscription as defined by Stripe * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "subscriptionID", value = "Unique ID of subscription as defined by Stripe") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public Subscription ownerNamespaceUuid(String ownerNamespaceUuid) { - this.ownerNamespaceUuid = ownerNamespaceUuid; return this; } - /** + /** * Unique ID of the array (product) owner * @return ownerNamespaceUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the array (product) owner") - public String getOwnerNamespaceUuid() { return ownerNamespaceUuid; } - public void setOwnerNamespaceUuid(String ownerNamespaceUuid) { this.ownerNamespaceUuid = ownerNamespaceUuid; } public Subscription customerNamespaceUuid(String customerNamespaceUuid) { - this.customerNamespaceUuid = customerNamespaceUuid; return this; } - /** + /** * Unique ID of the array (product) user (customer) * @return customerNamespaceUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the array (product) user (customer)") - public String getCustomerNamespaceUuid() { return customerNamespaceUuid; } - public void setCustomerNamespaceUuid(String customerNamespaceUuid) { this.customerNamespaceUuid = customerNamespaceUuid; } public Subscription pricing(List pricing) { - this.pricing = pricing; return this; } @@ -148,57 +143,19 @@ public Subscription addPricingItem(Pricing pricingItem) { return this; } - /** + /** * list of pricing used by this subscription * @return pricing - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of pricing used by this subscription") - public List getPricing() { return pricing; } - public void setPricing(List pricing) { this.pricing = pricing; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Subscription putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -213,13 +170,12 @@ public boolean equals(Object o) { return Objects.equals(this.id, subscription.id) && Objects.equals(this.ownerNamespaceUuid, subscription.ownerNamespaceUuid) && Objects.equals(this.customerNamespaceUuid, subscription.customerNamespaceUuid) && - Objects.equals(this.pricing, subscription.pricing)&& - Objects.equals(this.additionalProperties, subscription.additionalProperties); + Objects.equals(this.pricing, subscription.pricing); } @Override public int hashCode() { - return Objects.hash(id, ownerNamespaceUuid, customerNamespaceUuid, pricing, additionalProperties); + return Objects.hash(id, ownerNamespaceUuid, customerNamespaceUuid, pricing); } @Override @@ -230,7 +186,6 @@ public String toString() { sb.append(" ownerNamespaceUuid: ").append(toIndentedString(ownerNamespaceUuid)).append("\n"); sb.append(" customerNamespaceUuid: ").append(toIndentedString(customerNamespaceUuid)).append("\n"); sb.append(" pricing: ").append(toIndentedString(pricing)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -262,40 +217,49 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Subscription - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Subscription.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Subscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Subscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Subscription is not found in the empty JSON string", Subscription.openapiRequiredFields.toString())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Subscription.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Subscription` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("owner_namespace_uuid") != null && !jsonObj.get("owner_namespace_uuid").isJsonPrimitive()) { + if ((jsonObj.get("owner_namespace_uuid") != null && !jsonObj.get("owner_namespace_uuid").isJsonNull()) && !jsonObj.get("owner_namespace_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `owner_namespace_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_namespace_uuid").toString())); } - if (jsonObj.get("customer_namespace_uuid") != null && !jsonObj.get("customer_namespace_uuid").isJsonPrimitive()) { + if ((jsonObj.get("customer_namespace_uuid") != null && !jsonObj.get("customer_namespace_uuid").isJsonNull()) && !jsonObj.get("customer_namespace_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customer_namespace_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_namespace_uuid").toString())); } - JsonArray jsonArraypricing = jsonObj.getAsJsonArray("pricing"); - if (jsonArraypricing != null) { - // ensure the json data is an array - if (!jsonObj.get("pricing").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `pricing` to be an array in the JSON string but got `%s`", jsonObj.get("pricing").toString())); + if (jsonObj.get("pricing") != null && !jsonObj.get("pricing").isJsonNull()) { + JsonArray jsonArraypricing = jsonObj.getAsJsonArray("pricing"); + if (jsonArraypricing != null) { + // ensure the json data is an array + if (!jsonObj.get("pricing").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pricing` to be an array in the JSON string but got `%s`", jsonObj.get("pricing").toString())); + } + + // validate the optional field `pricing` (array) + for (int i = 0; i < jsonArraypricing.size(); i++) { + Pricing.validateJsonElement(jsonArraypricing.get(i)); + }; } - - // validate the optional field `pricing` (array) - for (int i = 0; i < jsonArraypricing.size(); i++) { - Pricing.validateJsonObject(jsonArraypricing.get(i).getAsJsonObject()); - }; } } @@ -314,71 +278,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Subscription value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Subscription read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Subscription instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Subscription given an JSON string - * - * @param jsonString JSON string - * @return An instance of Subscription - * @throws IOException if the JSON string is invalid with respect to Subscription - */ + /** + * Create an instance of Subscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of Subscription + * @throws IOException if the JSON string is invalid with respect to Subscription + */ public static Subscription fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Subscription.class); } - /** - * Convert an instance of Subscription to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Subscription 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/model/TGArrayNodeData.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGArrayNodeData.java index 7604c55..12b1fc4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGArrayNodeData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGArrayNodeData.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TGQueryRanges; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * The details of an array that should be queried and provided as the input to a UDF Node. This is essentially a `UDFArrayDetails`, but you’re allowed to provide most of the values as Nodes if you want. */ -@ApiModel(description = "The details of an array that should be queried and provided as the input to a UDF Node. This is essentially a `UDFArrayDetails`, but you’re allowed to provide most of the values as Nodes if you want. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGArrayNodeData { public static final String SERIALIZED_NAME_URI = "uri"; @SerializedName(SERIALIZED_NAME_URI) @@ -56,112 +64,65 @@ public class TGArrayNodeData { @SerializedName(SERIALIZED_NAME_BUFFERS) private Object buffers; - public TGArrayNodeData() { + public TGArrayNodeData() { } public TGArrayNodeData uri(Object uri) { - this.uri = uri; return this; } - /** + /** * An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } ") - public Object getUri() { return uri; } - public void setUri(Object uri) { this.uri = uri; } public TGArrayNodeData ranges(TGQueryRanges ranges) { - this.ranges = ranges; return this; } - /** + /** * Get ranges * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TGQueryRanges getRanges() { return ranges; } - public void setRanges(TGQueryRanges ranges) { this.ranges = ranges; } public TGArrayNodeData buffers(Object buffers) { - this.buffers = buffers; return this; } - /** + /** * An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } * @return buffers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } ") - public Object getBuffers() { return buffers; } - public void setBuffers(Object buffers) { this.buffers = buffers; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGArrayNodeData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +136,12 @@ public boolean equals(Object o) { TGArrayNodeData tgArrayNodeData = (TGArrayNodeData) o; return Objects.equals(this.uri, tgArrayNodeData.uri) && Objects.equals(this.ranges, tgArrayNodeData.ranges) && - Objects.equals(this.buffers, tgArrayNodeData.buffers)&& - Objects.equals(this.additionalProperties, tgArrayNodeData.additionalProperties); + Objects.equals(this.buffers, tgArrayNodeData.buffers); } @Override public int hashCode() { - return Objects.hash(uri, ranges, buffers, additionalProperties); + return Objects.hash(uri, ranges, buffers); } @Override @@ -191,7 +151,6 @@ public String toString() { sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); sb.append(" buffers: ").append(toIndentedString(buffers)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,23 +181,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGArrayNodeData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGArrayNodeData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGArrayNodeData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGArrayNodeData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGArrayNodeData is not found in the empty JSON string", TGArrayNodeData.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGArrayNodeData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGArrayNodeData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `ranges` - if (jsonObj.getAsJsonObject("ranges") != null) { - TGQueryRanges.validateJsonObject(jsonObj.getAsJsonObject("ranges")); + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull()) { + TGQueryRanges.validateJsonElement(jsonObj.get("ranges")); } } @@ -257,71 +223,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGArrayNodeData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGArrayNodeData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGArrayNodeData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGArrayNodeData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGArrayNodeData - * @throws IOException if the JSON string is invalid with respect to TGArrayNodeData - */ + /** + * Create an instance of TGArrayNodeData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGArrayNodeData + * @throws IOException if the JSON string is invalid with respect to TGArrayNodeData + */ public static TGArrayNodeData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGArrayNodeData.class); } - /** - * Convert an instance of TGArrayNodeData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGArrayNodeData 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/model/TGInputNodeData.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGInputNodeData.java index 6a81ab2..382e791 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGInputNodeData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGInputNodeData.java @@ -14,27 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +50,7 @@ /** * Specifies that a node is an “input value”, allowing for parameterized task graphs. An input node may not depend upon any other nodes. */ -@ApiModel(description = "Specifies that a node is an “input value”, allowing for parameterized task graphs. An input node may not depend upon any other nodes. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGInputNodeData { public static final String SERIALIZED_NAME_DEFAULT_VALUE = "default_value"; @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) @@ -53,89 +60,46 @@ public class TGInputNodeData { @SerializedName(SERIALIZED_NAME_DATATYPE) private String datatype; - public TGInputNodeData() { + public TGInputNodeData() { } public TGInputNodeData defaultValue(Object defaultValue) { - this.defaultValue = defaultValue; return this; } - /** + /** * An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } * @return defaultValue - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } ") - public Object getDefaultValue() { return defaultValue; } - public void setDefaultValue(Object defaultValue) { this.defaultValue = defaultValue; } public TGInputNodeData datatype(String datatype) { - this.datatype = datatype; return this; } - /** + /** * An annotation of what datatype this node is supposed to be. Conventionally, this is a Python-format type annotation, but it’s purely for documentation purposes and not validated. * @return datatype - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An annotation of what datatype this node is supposed to be. Conventionally, this is a Python-format type annotation, but it’s purely for documentation purposes and not validated. ") - public String getDatatype() { return datatype; } - public void setDatatype(String datatype) { this.datatype = datatype; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGInputNodeData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -148,8 +112,7 @@ public boolean equals(Object o) { } TGInputNodeData tgInputNodeData = (TGInputNodeData) o; return Objects.equals(this.defaultValue, tgInputNodeData.defaultValue) && - Objects.equals(this.datatype, tgInputNodeData.datatype)&& - Objects.equals(this.additionalProperties, tgInputNodeData.additionalProperties); + Objects.equals(this.datatype, tgInputNodeData.datatype); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -158,7 +121,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(defaultValue, datatype, additionalProperties); + return Objects.hash(defaultValue, datatype); } private static int hashCodeNullable(JsonNullable a) { @@ -174,7 +137,6 @@ public String toString() { sb.append("class TGInputNodeData {\n"); sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); sb.append(" datatype: ").append(toIndentedString(datatype)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,21 +166,28 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGInputNodeData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGInputNodeData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGInputNodeData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGInputNodeData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGInputNodeData is not found in the empty JSON string", TGInputNodeData.openapiRequiredFields.toString())); } } - if (jsonObj.get("datatype") != null && !jsonObj.get("datatype").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGInputNodeData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGInputNodeData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("datatype") != null && !jsonObj.get("datatype").isJsonNull()) && !jsonObj.get("datatype").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `datatype` to be a primitive type in the JSON string but got `%s`", jsonObj.get("datatype").toString())); } } @@ -238,71 +207,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGInputNodeData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGInputNodeData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGInputNodeData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGInputNodeData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGInputNodeData - * @throws IOException if the JSON string is invalid with respect to TGInputNodeData - */ + /** + * Create an instance of TGInputNodeData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGInputNodeData + * @throws IOException if the JSON string is invalid with respect to TGInputNodeData + */ public static TGInputNodeData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGInputNodeData.class); } - /** - * Convert an instance of TGInputNodeData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGInputNodeData 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/model/TGQueryRanges.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGQueryRanges.java index 3e7d4bd..978aa05 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGQueryRanges.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGQueryRanges.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Layout; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * Parameterizable version of `QueryRanges`. */ -@ApiModel(description = "Parameterizable version of `QueryRanges`.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGQueryRanges { public static final String SERIALIZED_NAME_LAYOUT = "layout"; @SerializedName(SERIALIZED_NAME_LAYOUT) @@ -56,112 +64,65 @@ public class TGQueryRanges { @SerializedName(SERIALIZED_NAME_RANGES) private Object ranges; - public TGQueryRanges() { + public TGQueryRanges() { } public TGQueryRanges layout(Layout layout) { - this.layout = layout; return this; } - /** + /** * Get layout * @return layout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Layout getLayout() { return layout; } - public void setLayout(Layout layout) { this.layout = layout; } public TGQueryRanges friendlyRanges(Object friendlyRanges) { - this.friendlyRanges = friendlyRanges; return this; } - /** + /** * An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } * @return friendlyRanges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } ") - public Object getFriendlyRanges() { return friendlyRanges; } - public void setFriendlyRanges(Object friendlyRanges) { this.friendlyRanges = friendlyRanges; } public TGQueryRanges ranges(Object ranges) { - this.ranges = ranges; return this; } - /** + /** * An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } ") - public Object getRanges() { return ranges; } - public void setRanges(Object ranges) { this.ranges = ranges; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGQueryRanges putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +136,12 @@ public boolean equals(Object o) { TGQueryRanges tgQueryRanges = (TGQueryRanges) o; return Objects.equals(this.layout, tgQueryRanges.layout) && Objects.equals(this.friendlyRanges, tgQueryRanges.friendlyRanges) && - Objects.equals(this.ranges, tgQueryRanges.ranges)&& - Objects.equals(this.additionalProperties, tgQueryRanges.additionalProperties); + Objects.equals(this.ranges, tgQueryRanges.ranges); } @Override public int hashCode() { - return Objects.hash(layout, friendlyRanges, ranges, additionalProperties); + return Objects.hash(layout, friendlyRanges, ranges); } @Override @@ -191,7 +151,6 @@ public String toString() { sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); sb.append(" friendlyRanges: ").append(toIndentedString(friendlyRanges)).append("\n"); sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,20 +181,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGQueryRanges - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGQueryRanges.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGQueryRanges + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGQueryRanges.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGQueryRanges is not found in the empty JSON string", TGQueryRanges.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGQueryRanges.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGQueryRanges` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `layout` + if (jsonObj.get("layout") != null && !jsonObj.get("layout").isJsonNull()) { + Layout.validateJsonElement(jsonObj.get("layout")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,71 +223,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGQueryRanges value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGQueryRanges read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGQueryRanges instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGQueryRanges given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGQueryRanges - * @throws IOException if the JSON string is invalid with respect to TGQueryRanges - */ + /** + * Create an instance of TGQueryRanges given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGQueryRanges + * @throws IOException if the JSON string is invalid with respect to TGQueryRanges + */ public static TGQueryRanges fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGQueryRanges.class); } - /** - * Convert an instance of TGQueryRanges to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGQueryRanges 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/model/TGSQLNodeData.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGSQLNodeData.java index d2036fd..965c5b0 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGSQLNodeData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGSQLNodeData.java @@ -14,30 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ResultFormat; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -45,12 +53,11 @@ /** * A node specifying an SQL query to execute in TileDB Cloud. */ -@ApiModel(description = "A node specifying an SQL query to execute in TileDB Cloud. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGSQLNodeData { public static final String SERIALIZED_NAME_INIT_COMMANDS = "init_commands"; @SerializedName(SERIALIZED_NAME_INIT_COMMANDS) - private List initCommands = null; + private List initCommands = new ArrayList<>(); public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @@ -58,7 +65,7 @@ public class TGSQLNodeData { public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; @SerializedName(SERIALIZED_NAME_PARAMETERS) - private List parameters = null; + private List parameters = new ArrayList<>(); public static final String SERIALIZED_NAME_RESULT_FORMAT = "result_format"; @SerializedName(SERIALIZED_NAME_RESULT_FORMAT) @@ -68,11 +75,10 @@ public class TGSQLNodeData { @SerializedName(SERIALIZED_NAME_NAMESPACE) private String namespace; - public TGSQLNodeData() { + public TGSQLNodeData() { } public TGSQLNodeData initCommands(List initCommands) { - this.initCommands = initCommands; return this; } @@ -85,48 +91,40 @@ public TGSQLNodeData addInitCommandsItem(String initCommandsItem) { return this; } - /** + /** * The commands to execute before running the query itself. * @return initCommands - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The commands to execute before running the query itself.") - public List getInitCommands() { return initCommands; } - public void setInitCommands(List initCommands) { this.initCommands = initCommands; } public TGSQLNodeData query(String query) { - this.query = query; return this; } - /** + /** * The text of the SQL query to execute. Parameters are substituted in for `?`s, just as in a regular MariaDB query. * @return query - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The text of the SQL query to execute. Parameters are substituted in for `?`s, just as in a regular MariaDB query. ") - public String getQuery() { return query; } - public void setQuery(String query) { this.query = query; } public TGSQLNodeData parameters(List parameters) { - this.parameters = parameters; return this; } @@ -139,103 +137,57 @@ public TGSQLNodeData addParametersItem(Object parametersItem) { return this; } - /** + /** * The parameters to substitute in for arguments in the `query`. Fixed-length. Arguments must be in JSON format. * @return parameters - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The parameters to substitute in for arguments in the `query`. Fixed-length. Arguments must be in JSON format. ") - public List getParameters() { return parameters; } - public void setParameters(List parameters) { this.parameters = parameters; } public TGSQLNodeData resultFormat(ResultFormat resultFormat) { - this.resultFormat = resultFormat; return this; } - /** + /** * Get resultFormat * @return resultFormat - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ResultFormat getResultFormat() { return resultFormat; } - public void setResultFormat(ResultFormat resultFormat) { this.resultFormat = resultFormat; } public TGSQLNodeData namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * If set, the non-default namespace to execute this SQL query under. * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the non-default namespace to execute this SQL query under. ") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGSQLNodeData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -251,8 +203,7 @@ public boolean equals(Object o) { Objects.equals(this.query, tgSQLNodeData.query) && Objects.equals(this.parameters, tgSQLNodeData.parameters) && Objects.equals(this.resultFormat, tgSQLNodeData.resultFormat) && - Objects.equals(this.namespace, tgSQLNodeData.namespace)&& - Objects.equals(this.additionalProperties, tgSQLNodeData.additionalProperties); + Objects.equals(this.namespace, tgSQLNodeData.namespace); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -261,7 +212,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(initCommands, query, parameters, resultFormat, namespace, additionalProperties); + return Objects.hash(initCommands, query, parameters, resultFormat, namespace); } private static int hashCodeNullable(JsonNullable a) { @@ -280,7 +231,6 @@ public String toString() { sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); sb.append(" resultFormat: ").append(toIndentedString(resultFormat)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -313,32 +263,43 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGSQLNodeData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGSQLNodeData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGSQLNodeData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGSQLNodeData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGSQLNodeData is not found in the empty JSON string", TGSQLNodeData.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("init_commands") != null && !jsonObj.get("init_commands").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGSQLNodeData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGSQLNodeData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("init_commands") != null && !jsonObj.get("init_commands").isJsonNull() && !jsonObj.get("init_commands").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `init_commands` to be an array in the JSON string but got `%s`", jsonObj.get("init_commands").toString())); } - if (jsonObj.get("query") != null && !jsonObj.get("query").isJsonPrimitive()) { + if ((jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) && !jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `query` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query").toString())); } - // ensure the json data is an array - if (jsonObj.get("parameters") != null && !jsonObj.get("parameters").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("parameters") != null && !jsonObj.get("parameters").isJsonNull() && !jsonObj.get("parameters").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `parameters` to be an array in the JSON string but got `%s`", jsonObj.get("parameters").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + // validate the optional field `result_format` + if (jsonObj.get("result_format") != null && !jsonObj.get("result_format").isJsonNull()) { + ResultFormat.validateJsonElement(jsonObj.get("result_format")); + } + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } } @@ -358,71 +319,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGSQLNodeData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGSQLNodeData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGSQLNodeData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGSQLNodeData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGSQLNodeData - * @throws IOException if the JSON string is invalid with respect to TGSQLNodeData - */ + /** + * Create an instance of TGSQLNodeData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGSQLNodeData + * @throws IOException if the JSON string is invalid with respect to TGSQLNodeData + */ public static TGSQLNodeData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGSQLNodeData.class); } - /** - * Convert an instance of TGSQLNodeData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGSQLNodeData 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/model/TGUDFArgument.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFArgument.java index 3f71d51..190ef9f 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFArgument.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFArgument.java @@ -14,27 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +50,7 @@ /** * A single argument to a UDF. This may represent a positional argument or a named argument, depending upon whether `name` is set. */ -@ApiModel(description = "A single argument to a UDF. This may represent a positional argument or a named argument, depending upon whether `name` is set. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGUDFArgument { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -53,89 +60,46 @@ public class TGUDFArgument { @SerializedName(SERIALIZED_NAME_VALUE) private Object value; - public TGUDFArgument() { + public TGUDFArgument() { } public TGUDFArgument name(String name) { - this.name = name; return this; } - /** + /** * The name of the argument, if present. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the argument, if present.") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public TGUDFArgument value(Object value) { - this.value = value; return this; } - /** + /** * An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An argument provided to a node. This is one of a direct value (i.e., a raw JSON value) or a `TGSentinel`. For example this Python value: {\"a\": [1, \"pipe\", range(30), None], \"b\": b\"bytes\"} is encoded thusly (with included comments): { // A dictionary with string keys is JSON-encodable. \"a\": [ // As is a list. 1, \"pipe\", { // A `range` is replaced with its pickle. \"__tdbudf__\": \"immediate\", \"format\": \"python_pickle\", \"base64_data\": \"gASVIAAAAAAAAACMCGJ1aWx0aW5zlIwFcmFuZ2WUk5RLAEseSwGHlFKULg==\" }, null ], \"b\": { // Raw binary data is encoded into base64. \"__tdbudf__\": \"immediate\" \"format\": \"bytes\", \"base64_data\": \"Ynl0ZXM=\" } } ") - public Object getValue() { return value; } - public void setValue(Object value) { this.value = value; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGUDFArgument putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -148,8 +112,7 @@ public boolean equals(Object o) { } TGUDFArgument tgUDFArgument = (TGUDFArgument) o; return Objects.equals(this.name, tgUDFArgument.name) && - Objects.equals(this.value, tgUDFArgument.value)&& - Objects.equals(this.additionalProperties, tgUDFArgument.additionalProperties); + Objects.equals(this.value, tgUDFArgument.value); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -158,7 +121,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(name, value, additionalProperties); + return Objects.hash(name, value); } private static int hashCodeNullable(JsonNullable a) { @@ -174,7 +137,6 @@ public String toString() { sb.append("class TGUDFArgument {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,21 +166,28 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGUDFArgument - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGUDFArgument.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGUDFArgument + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGUDFArgument.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGUDFArgument is not found in the empty JSON string", TGUDFArgument.openapiRequiredFields.toString())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGUDFArgument.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGUDFArgument` 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())); } } @@ -238,71 +207,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGUDFArgument value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGUDFArgument read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGUDFArgument instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGUDFArgument given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGUDFArgument - * @throws IOException if the JSON string is invalid with respect to TGUDFArgument - */ + /** + * Create an instance of TGUDFArgument given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGUDFArgument + * @throws IOException if the JSON string is invalid with respect to TGUDFArgument + */ public static TGUDFArgument fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGUDFArgument.class); } - /** - * Convert an instance of TGUDFArgument to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGUDFArgument 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/model/TGUDFEnvironment.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironment.java index 4d3d960..96063e7 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironment.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironment.java @@ -14,32 +14,41 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TGUDFEnvironmentResources; +import io.tiledb.cloud.rest_api.model.TGUDFStorage; +import io.tiledb.cloud.rest_api.model.UDFLanguage; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -47,8 +56,7 @@ /** * Metadata about the environment where we want to execute a UDF. */ -@ApiModel(description = "Metadata about the environment where we want to execute a UDF.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGUDFEnvironment { public static final String SERIALIZED_NAME_LANGUAGE = "language"; @SerializedName(SERIALIZED_NAME_LANGUAGE) @@ -88,220 +96,183 @@ public class TGUDFEnvironment { public static final String SERIALIZED_NAME_STORAGE = "storage"; @SerializedName(SERIALIZED_NAME_STORAGE) - private List storage = null; + private List storage = new ArrayList<>(); - public TGUDFEnvironment() { + public TGUDFEnvironment() { } public TGUDFEnvironment language(UDFLanguage language) { - this.language = language; return this; } - /** + /** * Get language * @return language - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFLanguage getLanguage() { return language; } - public void setLanguage(UDFLanguage language) { this.language = language; } public TGUDFEnvironment languageVersion(String languageVersion) { - this.languageVersion = languageVersion; return this; } - /** + /** * The language version used to execute this UDF. Neither this nor `language` needs to be set for registered UDFs, since the language and version are stored server-side with the UDF itself. * @return languageVersion - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The language version used to execute this UDF. Neither this nor `language` needs to be set for registered UDFs, since the language and version are stored server-side with the UDF itself. ") - public String getLanguageVersion() { return languageVersion; } - public void setLanguageVersion(String languageVersion) { this.languageVersion = languageVersion; } public TGUDFEnvironment imageName(String imageName) { - this.imageName = imageName; return this; } - /** + /** * The name of the image to use for the execution environment. * @return imageName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the image to use for the execution environment. ") - public String getImageName() { return imageName; } - public void setImageName(String imageName) { this.imageName = imageName; } public TGUDFEnvironment accessCredentialsName(String accessCredentialsName) { - this.accessCredentialsName = accessCredentialsName; return this; } - /** + /** * The name of the access credentials to use. if unset, no credentials will be configured in the environment. * @return accessCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the access credentials to use. if unset, no credentials will be configured in the environment. ") - public String getAccessCredentialsName() { return accessCredentialsName; } - public void setAccessCredentialsName(String accessCredentialsName) { this.accessCredentialsName = accessCredentialsName; } public TGUDFEnvironment namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * If set, the non-default namespace to execute this UDF under (and to query any Array Nodes that are used as inputs to this UDF). * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the non-default namespace to execute this UDF under (and to query any Array Nodes that are used as inputs to this UDF). ") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public TGUDFEnvironment resourceClass(String resourceClass) { - this.resourceClass = resourceClass; return this; } - /** + /** * The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the UDF will execute in the standard resource class of the TileDB Cloud provider. * @return resourceClass - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is empty, then the UDF will execute in the standard resource class of the TileDB Cloud provider. ") - public String getResourceClass() { return resourceClass; } - public void setResourceClass(String resourceClass) { this.resourceClass = resourceClass; } public TGUDFEnvironment resources(TGUDFEnvironmentResources resources) { - this.resources = resources; return this; } - /** + /** * Get resources * @return resources - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TGUDFEnvironmentResources getResources() { return resources; } - public void setResources(TGUDFEnvironmentResources resources) { this.resources = resources; } public TGUDFEnvironment runClientSide(Boolean runClientSide) { - this.runClientSide = runClientSide; return this; } - /** + /** * A hint that, if possible, this function should be executed on the client side rather than on the server. Registered UDFs and functions which take arrays as inputs can never be executed client-side. If the client’s environment is incompatible, or the client does not support client-side execution, the function will be executed on the server. * @return runClientSide - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A hint that, if possible, this function should be executed on the client side rather than on the server. Registered UDFs and functions which take arrays as inputs can never be executed client-side. If the client’s environment is incompatible, or the client does not support client-side execution, the function will be executed on the server. ") - public Boolean getRunClientSide() { return runClientSide; } - public void setRunClientSide(Boolean runClientSide) { this.runClientSide = runClientSide; } public TGUDFEnvironment timeout(BigDecimal timeout) { - this.timeout = timeout; return this; } - /** + /** * The maximum length of time this UDF is allowed to execute for before it is killed and fails. If not present (or zero), the function is allowed to run indefinitely (subject to the server’s global limits). * @return timeout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The maximum length of time this UDF is allowed to execute for before it is killed and fails. If not present (or zero), the function is allowed to run indefinitely (subject to the server’s global limits). ") - public BigDecimal getTimeout() { return timeout; } - public void setTimeout(BigDecimal timeout) { this.timeout = timeout; } public TGUDFEnvironment storage(List storage) { - this.storage = storage; return this; } @@ -314,57 +285,19 @@ public TGUDFEnvironment addStorageItem(TGUDFStorage storageItem) { return this; } - /** + /** * Storage options for mounting persistent volumes. * @return storage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Storage options for mounting persistent volumes. ") - public List getStorage() { return storage; } - public void setStorage(List storage) { this.storage = storage; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGUDFEnvironment putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -385,8 +318,7 @@ public boolean equals(Object o) { Objects.equals(this.resources, tgUDFEnvironment.resources) && Objects.equals(this.runClientSide, tgUDFEnvironment.runClientSide) && Objects.equals(this.timeout, tgUDFEnvironment.timeout) && - Objects.equals(this.storage, tgUDFEnvironment.storage)&& - Objects.equals(this.additionalProperties, tgUDFEnvironment.additionalProperties); + Objects.equals(this.storage, tgUDFEnvironment.storage); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -395,7 +327,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(language, languageVersion, imageName, accessCredentialsName, namespace, resourceClass, resources, runClientSide, timeout, storage, additionalProperties); + return Objects.hash(language, languageVersion, imageName, accessCredentialsName, namespace, resourceClass, resources, runClientSide, timeout, storage); } private static int hashCodeNullable(JsonNullable a) { @@ -419,7 +351,6 @@ public String toString() { sb.append(" runClientSide: ").append(toIndentedString(runClientSide)).append("\n"); sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); sb.append(" storage: ").append(toIndentedString(storage)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -457,50 +388,63 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGUDFEnvironment - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGUDFEnvironment.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGUDFEnvironment + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGUDFEnvironment.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGUDFEnvironment is not found in the empty JSON string", TGUDFEnvironment.openapiRequiredFields.toString())); } } - if (jsonObj.get("language_version") != null && !jsonObj.get("language_version").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGUDFEnvironment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGUDFEnvironment` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `language` + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) { + UDFLanguage.validateJsonElement(jsonObj.get("language")); + } + if ((jsonObj.get("language_version") != null && !jsonObj.get("language_version").isJsonNull()) && !jsonObj.get("language_version").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `language_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language_version").toString())); } - if (jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonPrimitive()) { + if ((jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonNull()) && !jsonObj.get("image_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `image_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_name").toString())); } - if (jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonPrimitive()) { + if ((jsonObj.get("access_credentials_name") != null && !jsonObj.get("access_credentials_name").isJsonNull()) && !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("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("resource_class") != null && !jsonObj.get("resource_class").isJsonPrimitive()) { + if ((jsonObj.get("resource_class") != null && !jsonObj.get("resource_class").isJsonNull()) && !jsonObj.get("resource_class").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `resource_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource_class").toString())); } // validate the optional field `resources` - if (jsonObj.getAsJsonObject("resources") != null) { - TGUDFEnvironmentResources.validateJsonObject(jsonObj.getAsJsonObject("resources")); + if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { + TGUDFEnvironmentResources.validateJsonElement(jsonObj.get("resources")); } - JsonArray jsonArraystorage = jsonObj.getAsJsonArray("storage"); - if (jsonArraystorage != null) { - // ensure the json data is an array - if (!jsonObj.get("storage").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `storage` to be an array in the JSON string but got `%s`", jsonObj.get("storage").toString())); + if (jsonObj.get("storage") != null && !jsonObj.get("storage").isJsonNull()) { + JsonArray jsonArraystorage = jsonObj.getAsJsonArray("storage"); + if (jsonArraystorage != null) { + // ensure the json data is an array + if (!jsonObj.get("storage").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `storage` to be an array in the JSON string but got `%s`", jsonObj.get("storage").toString())); + } + + // validate the optional field `storage` (array) + for (int i = 0; i < jsonArraystorage.size(); i++) { + TGUDFStorage.validateJsonElement(jsonArraystorage.get(i)); + }; } - - // validate the optional field `storage` (array) - for (int i = 0; i < jsonArraystorage.size(); i++) { - TGUDFStorage.validateJsonObject(jsonArraystorage.get(i).getAsJsonObject()); - }; } } @@ -519,71 +463,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGUDFEnvironment value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGUDFEnvironment read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGUDFEnvironment instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGUDFEnvironment given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGUDFEnvironment - * @throws IOException if the JSON string is invalid with respect to TGUDFEnvironment - */ + /** + * Create an instance of TGUDFEnvironment given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGUDFEnvironment + * @throws IOException if the JSON string is invalid with respect to TGUDFEnvironment + */ public static TGUDFEnvironment fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGUDFEnvironment.class); } - /** - * Convert an instance of TGUDFEnvironment to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGUDFEnvironment 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/model/TGUDFEnvironmentResources.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResources.java index 0f96fe2..d7a1e57 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResources.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResources.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * The resources requested for this particular node. If resources are not specified resource_class is used, if it is not set the standard resource // defaults are used */ -@ApiModel(description = "The resources requested for this particular node. If resources are not specified resource_class is used, if it is not set the standard resource // defaults are used ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGUDFEnvironmentResources { public static final String SERIALIZED_NAME_CPU = "cpu"; @SerializedName(SERIALIZED_NAME_CPU) @@ -56,112 +63,65 @@ public class TGUDFEnvironmentResources { @SerializedName(SERIALIZED_NAME_GPU) private Integer gpu; - public TGUDFEnvironmentResources() { + public TGUDFEnvironmentResources() { } public TGUDFEnvironmentResources cpu(String cpu) { - this.cpu = cpu; return this; } - /** + /** * Get cpu * @return cpu - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "500m", value = "") - public String getCpu() { return cpu; } - public void setCpu(String cpu) { this.cpu = cpu; } public TGUDFEnvironmentResources memory(String memory) { - this.memory = memory; return this; } - /** + /** * Get memory * @return memory - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "8Gi", value = "") - public String getMemory() { return memory; } - public void setMemory(String memory) { this.memory = memory; } public TGUDFEnvironmentResources gpu(Integer gpu) { - this.gpu = gpu; return this; } - /** + /** * Get gpu * @return gpu - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "") - public Integer getGpu() { return gpu; } - public void setGpu(Integer gpu) { this.gpu = gpu; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGUDFEnvironmentResources putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { TGUDFEnvironmentResources tgUDFEnvironmentResources = (TGUDFEnvironmentResources) o; return Objects.equals(this.cpu, tgUDFEnvironmentResources.cpu) && Objects.equals(this.memory, tgUDFEnvironmentResources.memory) && - Objects.equals(this.gpu, tgUDFEnvironmentResources.gpu)&& - Objects.equals(this.additionalProperties, tgUDFEnvironmentResources.additionalProperties); + Objects.equals(this.gpu, tgUDFEnvironmentResources.gpu); } @Override public int hashCode() { - return Objects.hash(cpu, memory, gpu, additionalProperties); + return Objects.hash(cpu, memory, gpu); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" cpu: ").append(toIndentedString(cpu)).append("\n"); sb.append(" memory: ").append(toIndentedString(memory)).append("\n"); sb.append(" gpu: ").append(toIndentedString(gpu)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,24 +180,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGUDFEnvironmentResources - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGUDFEnvironmentResources.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGUDFEnvironmentResources + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGUDFEnvironmentResources.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGUDFEnvironmentResources is not found in the empty JSON string", TGUDFEnvironmentResources.openapiRequiredFields.toString())); } } - if (jsonObj.get("cpu") != null && !jsonObj.get("cpu").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGUDFEnvironmentResources.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGUDFEnvironmentResources` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cpu") != null && !jsonObj.get("cpu").isJsonNull()) && !jsonObj.get("cpu").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cpu` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cpu").toString())); } - if (jsonObj.get("memory") != null && !jsonObj.get("memory").isJsonPrimitive()) { + if ((jsonObj.get("memory") != null && !jsonObj.get("memory").isJsonNull()) && !jsonObj.get("memory").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `memory` to be a primitive type in the JSON string but got `%s`", jsonObj.get("memory").toString())); } } @@ -259,71 +224,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGUDFEnvironmentResources value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGUDFEnvironmentResources read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGUDFEnvironmentResources instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGUDFEnvironmentResources given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGUDFEnvironmentResources - * @throws IOException if the JSON string is invalid with respect to TGUDFEnvironmentResources - */ + /** + * Create an instance of TGUDFEnvironmentResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGUDFEnvironmentResources + * @throws IOException if the JSON string is invalid with respect to TGUDFEnvironmentResources + */ public static TGUDFEnvironmentResources fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGUDFEnvironmentResources.class); } - /** - * Convert an instance of TGUDFEnvironmentResources to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGUDFEnvironmentResources 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/model/TGUDFNodeData.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFNodeData.java index 0bc4cd5..484ba10 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFNodeData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFNodeData.java @@ -14,39 +14,48 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ResultFormat; +import io.tiledb.cloud.rest_api.model.TGUDFArgument; +import io.tiledb.cloud.rest_api.model.TGUDFEnvironment; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * A node specifying the execution of a user-defined function. */ -@ApiModel(description = "A node specifying the execution of a user-defined function.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGUDFNodeData { public static final String SERIALIZED_NAME_REGISTERED_UDF_NAME = "registered_udf_name"; @SerializedName(SERIALIZED_NAME_REGISTERED_UDF_NAME) @@ -66,109 +75,92 @@ public class TGUDFNodeData { public static final String SERIALIZED_NAME_ARGUMENTS = "arguments"; @SerializedName(SERIALIZED_NAME_ARGUMENTS) - private List arguments = null; + private List arguments = new ArrayList<>(); public static final String SERIALIZED_NAME_RESULT_FORMAT = "result_format"; @SerializedName(SERIALIZED_NAME_RESULT_FORMAT) private ResultFormat resultFormat; - public TGUDFNodeData() { + public TGUDFNodeData() { } public TGUDFNodeData registeredUdfName(String registeredUdfName) { - this.registeredUdfName = registeredUdfName; return this; } - /** + /** * If set, the name of the registered UDF to execute, in the format `namespace/name`. Either this or `executable_code` should be set, but not both. * @return registeredUdfName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the name of the registered UDF to execute, in the format `namespace/name`. Either this or `executable_code` should be set, but not both. ") - public String getRegisteredUdfName() { return registeredUdfName; } - public void setRegisteredUdfName(String registeredUdfName) { this.registeredUdfName = registeredUdfName; } public TGUDFNodeData executableCode(String executableCode) { - this.executableCode = executableCode; return this; } - /** + /** * If set, the base64 serialization of the code for this step, encoded in a language-specific format (e.g. Pickle for Python, serialization for R). * @return executableCode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set, the base64 serialization of the code for this step, encoded in a language-specific format (e.g. Pickle for Python, serialization for R). ") - public String getExecutableCode() { return executableCode; } - public void setExecutableCode(String executableCode) { this.executableCode = executableCode; } public TGUDFNodeData sourceText(String sourceText) { - this.sourceText = sourceText; return this; } - /** + /** * Optionally, the source text for the code passed in `executable_code`. *For reference only; only the code in `executable_code` is actually executed.* This will be included in activity logs and may be useful for debugging. * @return sourceText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optionally, the source text for the code passed in `executable_code`. *For reference only; only the code in `executable_code` is actually executed.* This will be included in activity logs and may be useful for debugging. ") - public String getSourceText() { return sourceText; } - public void setSourceText(String sourceText) { this.sourceText = sourceText; } public TGUDFNodeData environment(TGUDFEnvironment environment) { - this.environment = environment; return this; } - /** + /** * Get environment * @return environment - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TGUDFEnvironment getEnvironment() { return environment; } - public void setEnvironment(TGUDFEnvironment environment) { this.environment = environment; } public TGUDFNodeData arguments(List arguments) { - this.arguments = arguments; return this; } @@ -181,80 +173,38 @@ public TGUDFNodeData addArgumentsItem(TGUDFArgument argumentsItem) { return this; } - /** + /** * The arguments to a UDF function. This encompasses both named and positional arguments. The format is designed to provide compatibility across languages like Python which have a fairly traditional split between positional arguments and named arguments, and languages like R which has a rather unique way of specifying arguments. For Python (and most other languages), all positional arguments will come before all named arguments (if any are present): // fn(arg1, arg2, arg3) [ {value: arg1}, {value: arg2}, {value: arg3}, ] // fn(arg1, arg2, n=kw1, a=kw2) [ {value: arg1}, {value: arg2}, {name: \"n\", value: kw1}, {name: \"a\", value: kw2}, ] // fn(kw=k1, only=k2) [ {name: \"kw\", value: k1}, {name: \"only\", value: k2}, ] However, in R, named and positional arguments may be intermixed freely: // fn(arg, n=kw1, arg2) [ {value: arg}, {name: \"n\", value: kw1}, {value: arg2}, ] * @return arguments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The arguments to a UDF function. This encompasses both named and positional arguments. The format is designed to provide compatibility across languages like Python which have a fairly traditional split between positional arguments and named arguments, and languages like R which has a rather unique way of specifying arguments. For Python (and most other languages), all positional arguments will come before all named arguments (if any are present): // fn(arg1, arg2, arg3) [ {value: arg1}, {value: arg2}, {value: arg3}, ] // fn(arg1, arg2, n=kw1, a=kw2) [ {value: arg1}, {value: arg2}, {name: \"n\", value: kw1}, {name: \"a\", value: kw2}, ] // fn(kw=k1, only=k2) [ {name: \"kw\", value: k1}, {name: \"only\", value: k2}, ] However, in R, named and positional arguments may be intermixed freely: // fn(arg, n=kw1, arg2) [ {value: arg}, {name: \"n\", value: kw1}, {value: arg2}, ] ") - public List getArguments() { return arguments; } - public void setArguments(List arguments) { this.arguments = arguments; } public TGUDFNodeData resultFormat(ResultFormat resultFormat) { - this.resultFormat = resultFormat; return this; } - /** + /** * Get resultFormat * @return resultFormat - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ResultFormat getResultFormat() { return resultFormat; } - public void setResultFormat(ResultFormat resultFormat) { this.resultFormat = resultFormat; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGUDFNodeData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -271,8 +221,7 @@ public boolean equals(Object o) { Objects.equals(this.sourceText, tgUDFNodeData.sourceText) && Objects.equals(this.environment, tgUDFNodeData.environment) && Objects.equals(this.arguments, tgUDFNodeData.arguments) && - Objects.equals(this.resultFormat, tgUDFNodeData.resultFormat)&& - Objects.equals(this.additionalProperties, tgUDFNodeData.additionalProperties); + Objects.equals(this.resultFormat, tgUDFNodeData.resultFormat); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -281,7 +230,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(registeredUdfName, executableCode, sourceText, environment, arguments, resultFormat, additionalProperties); + return Objects.hash(registeredUdfName, executableCode, sourceText, environment, arguments, resultFormat); } private static int hashCodeNullable(JsonNullable a) { @@ -301,7 +250,6 @@ public String toString() { sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); sb.append(" resultFormat: ").append(toIndentedString(resultFormat)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -335,44 +283,57 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGUDFNodeData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGUDFNodeData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGUDFNodeData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGUDFNodeData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGUDFNodeData is not found in the empty JSON string", TGUDFNodeData.openapiRequiredFields.toString())); } } - if (jsonObj.get("registered_udf_name") != null && !jsonObj.get("registered_udf_name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGUDFNodeData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGUDFNodeData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("registered_udf_name") != null && !jsonObj.get("registered_udf_name").isJsonNull()) && !jsonObj.get("registered_udf_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `registered_udf_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registered_udf_name").toString())); } - if (jsonObj.get("executable_code") != null && !jsonObj.get("executable_code").isJsonPrimitive()) { + if ((jsonObj.get("executable_code") != null && !jsonObj.get("executable_code").isJsonNull()) && !jsonObj.get("executable_code").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `executable_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executable_code").toString())); } - if (jsonObj.get("source_text") != null && !jsonObj.get("source_text").isJsonPrimitive()) { + if ((jsonObj.get("source_text") != null && !jsonObj.get("source_text").isJsonNull()) && !jsonObj.get("source_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `source_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_text").toString())); } // validate the optional field `environment` - if (jsonObj.getAsJsonObject("environment") != null) { - TGUDFEnvironment.validateJsonObject(jsonObj.getAsJsonObject("environment")); + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { + TGUDFEnvironment.validateJsonElement(jsonObj.get("environment")); } - JsonArray jsonArrayarguments = jsonObj.getAsJsonArray("arguments"); - if (jsonArrayarguments != null) { - // ensure the json data is an array - if (!jsonObj.get("arguments").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `arguments` to be an array in the JSON string but got `%s`", jsonObj.get("arguments").toString())); + if (jsonObj.get("arguments") != null && !jsonObj.get("arguments").isJsonNull()) { + JsonArray jsonArrayarguments = jsonObj.getAsJsonArray("arguments"); + if (jsonArrayarguments != null) { + // ensure the json data is an array + if (!jsonObj.get("arguments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arguments` to be an array in the JSON string but got `%s`", jsonObj.get("arguments").toString())); + } + + // validate the optional field `arguments` (array) + for (int i = 0; i < jsonArrayarguments.size(); i++) { + TGUDFArgument.validateJsonElement(jsonArrayarguments.get(i)); + }; } - - // validate the optional field `arguments` (array) - for (int i = 0; i < jsonArrayarguments.size(); i++) { - TGUDFArgument.validateJsonObject(jsonArrayarguments.get(i).getAsJsonObject()); - }; + } + // validate the optional field `result_format` + if (jsonObj.get("result_format") != null && !jsonObj.get("result_format").isJsonNull()) { + ResultFormat.validateJsonElement(jsonObj.get("result_format")); } } @@ -391,71 +352,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGUDFNodeData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGUDFNodeData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGUDFNodeData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGUDFNodeData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGUDFNodeData - * @throws IOException if the JSON string is invalid with respect to TGUDFNodeData - */ + /** + * Create an instance of TGUDFNodeData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGUDFNodeData + * @throws IOException if the JSON string is invalid with respect to TGUDFNodeData + */ public static TGUDFNodeData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGUDFNodeData.class); } - /** - * Convert an instance of TGUDFNodeData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGUDFNodeData 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/model/TGUDFStorage.java b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFStorage.java index d747de5..0944a66 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFStorage.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TGUDFStorage.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Storage options for mounting persistent volumes. */ -@ApiModel(description = "Storage options for mounting persistent volumes.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TGUDFStorage { public static final String SERIALIZED_NAME_PATH = "path"; @SerializedName(SERIALIZED_NAME_PATH) @@ -60,135 +67,84 @@ public class TGUDFStorage { @SerializedName(SERIALIZED_NAME_STORAGE_CLASS) private String storageClass; - public TGUDFStorage() { + public TGUDFStorage() { } public TGUDFStorage path(String path) { - this.path = path; return this; } - /** + /** * Mount path for the attached volume. * @return path - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Mount path for the attached volume. ") - public String getPath() { return path; } - public void setPath(String path) { this.path = path; } public TGUDFStorage tiledbUri(String tiledbUri) { - this.tiledbUri = tiledbUri; return this; } - /** + /** * TileDB filesystem to mount * @return tiledbUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "tiledb:///", value = "TileDB filesystem to mount ") - public String getTiledbUri() { return tiledbUri; } - public void setTiledbUri(String tiledbUri) { this.tiledbUri = tiledbUri; } public TGUDFStorage size(String size) { - this.size = size; return this; } - /** + /** * Storage size. * @return size - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "8Gi", value = "Storage size. ") - public String getSize() { return size; } - public void setSize(String size) { this.size = size; } public TGUDFStorage storageClass(String storageClass) { - this.storageClass = storageClass; return this; } - /** + /** * Storage class to use for creating the volume. * @return storageClass - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "gp2", value = "Storage class to use for creating the volume. ") - public String getStorageClass() { return storageClass; } - public void setStorageClass(String storageClass) { this.storageClass = storageClass; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TGUDFStorage putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +159,12 @@ public boolean equals(Object o) { return Objects.equals(this.path, tgUDFStorage.path) && Objects.equals(this.tiledbUri, tgUDFStorage.tiledbUri) && Objects.equals(this.size, tgUDFStorage.size) && - Objects.equals(this.storageClass, tgUDFStorage.storageClass)&& - Objects.equals(this.additionalProperties, tgUDFStorage.additionalProperties); + Objects.equals(this.storageClass, tgUDFStorage.storageClass); } @Override public int hashCode() { - return Objects.hash(path, tiledbUri, size, storageClass, additionalProperties); + return Objects.hash(path, tiledbUri, size, storageClass); } @Override @@ -220,7 +175,6 @@ public String toString() { sb.append(" tiledbUri: ").append(toIndentedString(tiledbUri)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" storageClass: ").append(toIndentedString(storageClass)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -252,30 +206,37 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TGUDFStorage - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TGUDFStorage.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TGUDFStorage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TGUDFStorage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TGUDFStorage is not found in the empty JSON string", TGUDFStorage.openapiRequiredFields.toString())); } } - if (jsonObj.get("path") != null && !jsonObj.get("path").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TGUDFStorage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TGUDFStorage` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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("tiledb_uri") != null && !jsonObj.get("tiledb_uri").isJsonPrimitive()) { + if ((jsonObj.get("tiledb_uri") != null && !jsonObj.get("tiledb_uri").isJsonNull()) && !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())); } - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonPrimitive()) { + if ((jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) && !jsonObj.get("size").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("size").toString())); } - if (jsonObj.get("storage_class") != null && !jsonObj.get("storage_class").isJsonPrimitive()) { + if ((jsonObj.get("storage_class") != null && !jsonObj.get("storage_class").isJsonNull()) && !jsonObj.get("storage_class").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `storage_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storage_class").toString())); } } @@ -295,71 +256,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TGUDFStorage value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TGUDFStorage read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TGUDFStorage instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TGUDFStorage given an JSON string - * - * @param jsonString JSON string - * @return An instance of TGUDFStorage - * @throws IOException if the JSON string is invalid with respect to TGUDFStorage - */ + /** + * Create an instance of TGUDFStorage given an JSON string + * + * @param jsonString JSON string + * @return An instance of TGUDFStorage + * @throws IOException if the JSON string is invalid with respect to TGUDFStorage + */ public static TGUDFStorage fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TGUDFStorage.class); } - /** - * Convert an instance of TGUDFStorage to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TGUDFStorage 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/model/TaskGraph.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraph.java index 12abc3b..2cb0d93 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraph.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraph.java @@ -14,32 +14,41 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.RetryStrategy; +import io.tiledb.cloud.rest_api.model.TaskGraphNode; +import io.tiledb.cloud.rest_api.model.TaskGraphType; import java.io.IOException; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -47,8 +56,7 @@ /** * Information about a task graph. */ -@ApiModel(description = "Information about a task graph.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraph { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) @@ -72,7 +80,7 @@ public class TaskGraph { public static final String SERIALIZED_NAME_NODES = "nodes"; @SerializedName(SERIALIZED_NAME_NODES) - private List nodes = null; + private List nodes = new ArrayList<>(); public static final String SERIALIZED_NAME_PARALLELISM = "parallelism"; @SerializedName(SERIALIZED_NAME_PARALLELISM) @@ -90,10 +98,9 @@ public class TaskGraph { @SerializedName(SERIALIZED_NAME_TASK_GRAPH_TYPE) private TaskGraphType taskGraphType; - public TaskGraph() { + public TaskGraph() { } - public TaskGraph( String uuid, String createdBy, @@ -105,96 +112,78 @@ public TaskGraph( this.createdAt = createdAt; } - /** + /** * The server-generated UUID of the task graph. * @return uuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The server-generated UUID of the task graph.") - public String getUuid() { return uuid; } - public TaskGraph namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * The namespace that owns this task graph. When creating a task graph log, this is used as the namespace to create the log in; thereafter it is read-only. * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The namespace that owns this task graph. When creating a task graph log, this is used as the namespace to create the log in; thereafter it is read-only. ") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } - /** + /** * The name of the user who created this task graph log. * @return createdBy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the user who created this task graph log.") - public String getCreatedBy() { return createdBy; } - public TaskGraph name(String name) { - this.name = name; return this; } - /** + /** * A name for this task graph, displayed in the UI. Does not need to be unique. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A name for this task graph, displayed in the UI. Does not need to be unique. ") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** + /** * The date/time when this task graph was originally created. * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The date/time when this task graph was originally created. ") - public OffsetDateTime getCreatedAt() { return createdAt; } - public TaskGraph nodes(List nodes) { - this.nodes = nodes; return this; } @@ -207,149 +196,95 @@ public TaskGraph addNodesItem(TaskGraphNode nodesItem) { return this; } - /** + /** * The structure of the graph. This is provided by the client when first setting up the task graph. This must be topographically sorted; that is, each node must appear after all nodes that it depends upon. * @return nodes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The structure of the graph. This is provided by the client when first setting up the task graph. This must be topographically sorted; that is, each node must appear after all nodes that it depends upon. ") - public List getNodes() { return nodes; } - public void setNodes(List nodes) { this.nodes = nodes; } public TaskGraph parallelism(Long parallelism) { - this.parallelism = parallelism; return this; } - /** + /** * Parallelism limits the max total parallel pods that can execute at the same time in a workflow. * @return parallelism - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Parallelism limits the max total parallel pods that can execute at the same time in a workflow. ") - public Long getParallelism() { return parallelism; } - public void setParallelism(Long parallelism) { this.parallelism = parallelism; } public TaskGraph retryStrategy(RetryStrategy retryStrategy) { - this.retryStrategy = retryStrategy; return this; } - /** + /** * Get retryStrategy * @return retryStrategy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public RetryStrategy getRetryStrategy() { return retryStrategy; } - public void setRetryStrategy(RetryStrategy retryStrategy) { this.retryStrategy = retryStrategy; } public TaskGraph deadline(Long deadline) { - this.deadline = deadline; return this; } - /** + /** * Duration in seconds relative to the workflow start time which the workflow is allowed to run before it gets terminated. Defaults to 24h when unset * @return deadline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Duration in seconds relative to the workflow start time which the workflow is allowed to run before it gets terminated. Defaults to 24h when unset ") - public Long getDeadline() { return deadline; } - public void setDeadline(Long deadline) { this.deadline = deadline; } public TaskGraph taskGraphType(TaskGraphType taskGraphType) { - this.taskGraphType = taskGraphType; return this; } - /** + /** * Get taskGraphType * @return taskGraphType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TaskGraphType getTaskGraphType() { return taskGraphType; } - public void setTaskGraphType(TaskGraphType taskGraphType) { this.taskGraphType = taskGraphType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraph putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -370,8 +305,7 @@ public boolean equals(Object o) { Objects.equals(this.parallelism, taskGraph.parallelism) && Objects.equals(this.retryStrategy, taskGraph.retryStrategy) && Objects.equals(this.deadline, taskGraph.deadline) && - Objects.equals(this.taskGraphType, taskGraph.taskGraphType)&& - Objects.equals(this.additionalProperties, taskGraph.additionalProperties); + Objects.equals(this.taskGraphType, taskGraph.taskGraphType); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -380,7 +314,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(uuid, namespace, createdBy, name, createdAt, nodes, parallelism, retryStrategy, deadline, taskGraphType, additionalProperties); + return Objects.hash(uuid, namespace, createdBy, name, createdAt, nodes, parallelism, retryStrategy, deadline, taskGraphType); } private static int hashCodeNullable(JsonNullable a) { @@ -404,7 +338,6 @@ public String toString() { sb.append(" retryStrategy: ").append(toIndentedString(retryStrategy)).append("\n"); sb.append(" deadline: ").append(toIndentedString(deadline)).append("\n"); sb.append(" taskGraphType: ").append(toIndentedString(taskGraphType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -442,47 +375,60 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraph - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraph.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraph + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraph.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraph is not found in the empty JSON string", TaskGraph.openapiRequiredFields.toString())); } } - if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraph.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraph` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonPrimitive()) { + if ((jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) && !jsonObj.get("created_by").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `created_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_by").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } - JsonArray jsonArraynodes = jsonObj.getAsJsonArray("nodes"); - if (jsonArraynodes != null) { - // ensure the json data is an array - if (!jsonObj.get("nodes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `nodes` to be an array in the JSON string but got `%s`", jsonObj.get("nodes").toString())); + if (jsonObj.get("nodes") != null && !jsonObj.get("nodes").isJsonNull()) { + JsonArray jsonArraynodes = jsonObj.getAsJsonArray("nodes"); + if (jsonArraynodes != null) { + // ensure the json data is an array + if (!jsonObj.get("nodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodes` to be an array in the JSON string but got `%s`", jsonObj.get("nodes").toString())); + } + + // validate the optional field `nodes` (array) + for (int i = 0; i < jsonArraynodes.size(); i++) { + TaskGraphNode.validateJsonElement(jsonArraynodes.get(i)); + }; } - - // validate the optional field `nodes` (array) - for (int i = 0; i < jsonArraynodes.size(); i++) { - TaskGraphNode.validateJsonObject(jsonArraynodes.get(i).getAsJsonObject()); - }; } // validate the optional field `retry_strategy` - if (jsonObj.getAsJsonObject("retry_strategy") != null) { - RetryStrategy.validateJsonObject(jsonObj.getAsJsonObject("retry_strategy")); + if (jsonObj.get("retry_strategy") != null && !jsonObj.get("retry_strategy").isJsonNull()) { + RetryStrategy.validateJsonElement(jsonObj.get("retry_strategy")); + } + // validate the optional field `task_graph_type` + if (jsonObj.get("task_graph_type") != null && !jsonObj.get("task_graph_type").isJsonNull()) { + TaskGraphType.validateJsonElement(jsonObj.get("task_graph_type")); } } @@ -501,71 +447,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraph value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraph read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraph instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraph given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraph - * @throws IOException if the JSON string is invalid with respect to TaskGraph - */ + /** + * Create an instance of TaskGraph given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraph + * @throws IOException if the JSON string is invalid with respect to TaskGraph + */ public static TaskGraph fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraph.class); } - /** - * Convert an instance of TaskGraph to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraph 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/model/TaskGraphActions.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphActions.java index 85777dc..9ab8160 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphActions.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphActions.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public TaskGraphActions read(final JsonReader jsonReader) throws IOException { return TaskGraphActions.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskGraphActions.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatus.java index 3b151fd..52a4721 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatus.java @@ -14,34 +14,43 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayTaskStatus; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * A report of the execution status of a node that ran on the client side. */ -@ApiModel(description = "A report of the execution status of a node that ran on the client side. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphClientNodeStatus { public static final String SERIALIZED_NAME_CLIENT_NODE_UUID = "client_node_uuid"; @SerializedName(SERIALIZED_NAME_CLIENT_NODE_UUID) @@ -51,89 +60,46 @@ public class TaskGraphClientNodeStatus { @SerializedName(SERIALIZED_NAME_STATUS) private ArrayTaskStatus status; - public TaskGraphClientNodeStatus() { + public TaskGraphClientNodeStatus() { } public TaskGraphClientNodeStatus clientNodeUuid(String clientNodeUuid) { - this.clientNodeUuid = clientNodeUuid; return this; } - /** + /** * Get clientNodeUuid * @return clientNodeUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getClientNodeUuid() { return clientNodeUuid; } - public void setClientNodeUuid(String clientNodeUuid) { this.clientNodeUuid = clientNodeUuid; } public TaskGraphClientNodeStatus status(ArrayTaskStatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayTaskStatus getStatus() { return status; } - public void setStatus(ArrayTaskStatus status) { this.status = status; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphClientNodeStatus putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -146,13 +112,12 @@ public boolean equals(Object o) { } TaskGraphClientNodeStatus taskGraphClientNodeStatus = (TaskGraphClientNodeStatus) o; return Objects.equals(this.clientNodeUuid, taskGraphClientNodeStatus.clientNodeUuid) && - Objects.equals(this.status, taskGraphClientNodeStatus.status)&& - Objects.equals(this.additionalProperties, taskGraphClientNodeStatus.additionalProperties); + Objects.equals(this.status, taskGraphClientNodeStatus.status); } @Override public int hashCode() { - return Objects.hash(clientNodeUuid, status, additionalProperties); + return Objects.hash(clientNodeUuid, status); } @Override @@ -161,7 +126,6 @@ public String toString() { sb.append("class TaskGraphClientNodeStatus {\n"); sb.append(" clientNodeUuid: ").append(toIndentedString(clientNodeUuid)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -191,23 +155,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphClientNodeStatus - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphClientNodeStatus.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphClientNodeStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphClientNodeStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphClientNodeStatus is not found in the empty JSON string", TaskGraphClientNodeStatus.openapiRequiredFields.toString())); } } - if (jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphClientNodeStatus.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphClientNodeStatus` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonNull()) && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `client_node_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_uuid").toString())); } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + ArrayTaskStatus.validateJsonElement(jsonObj.get("status")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -225,71 +200,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphClientNodeStatus value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphClientNodeStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphClientNodeStatus instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphClientNodeStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphClientNodeStatus - * @throws IOException if the JSON string is invalid with respect to TaskGraphClientNodeStatus - */ + /** + * Create an instance of TaskGraphClientNodeStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphClientNodeStatus + * @throws IOException if the JSON string is invalid with respect to TaskGraphClientNodeStatus + */ public static TaskGraphClientNodeStatus fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphClientNodeStatus.class); } - /** - * Convert an instance of TaskGraphClientNodeStatus to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphClientNodeStatus 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/model/TaskGraphLog.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLog.java index 39d4943..c66942e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLog.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLog.java @@ -14,33 +14,44 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TaskGraphLogStatus; +import io.tiledb.cloud.rest_api.model.TaskGraphNodeMetadata; +import io.tiledb.cloud.rest_api.model.TaskGraphType; import java.io.IOException; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; - +import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; +import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -48,8 +59,7 @@ /** * Logging information about the execution of a task graph. */ -@ApiModel(description = "Logging information about the execution of a task graph.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphLog { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) @@ -101,11 +111,11 @@ public class TaskGraphLog { public static final String SERIALIZED_NAME_STATUS_COUNT = "status_count"; @SerializedName(SERIALIZED_NAME_STATUS_COUNT) - private Map statusCount = null; + private Map statusCount = new HashMap<>(); public static final String SERIALIZED_NAME_NODES = "nodes"; @SerializedName(SERIALIZED_NAME_NODES) - private List nodes = null; + private List nodes = new ArrayList<>(); public static final String SERIALIZED_NAME_TASK_GRAPH_TYPE = "task_graph_type"; @SerializedName(SERIALIZED_NAME_TASK_GRAPH_TYPE) @@ -129,12 +139,11 @@ public class TaskGraphLog { public static final String SERIALIZED_NAME_CHILDREN_TASK_GRAPH_UUIDS = "children_task_graph_uuids"; @SerializedName(SERIALIZED_NAME_CHILDREN_TASK_GRAPH_UUIDS) - private List childrenTaskGraphUuids = null; + private List childrenTaskGraphUuids = new ArrayList<>(); - public TaskGraphLog() { + public TaskGraphLog() { } - public TaskGraphLog( String uuid, String createdBy, @@ -150,239 +159,195 @@ public TaskGraphLog( this.endTime = endTime; } - /** + /** * The server-generated UUID of the task graph. * @return uuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The server-generated UUID of the task graph.") - public String getUuid() { return uuid; } - public TaskGraphLog namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * The namespace that owns this task graph log. When creating a task graph log, this is used as the namespace to create the log in; thereafter it is read-only. * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The namespace that owns this task graph log. When creating a task graph log, this is used as the namespace to create the log in; thereafter it is read-only. ") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } - /** + /** * The name of the user who created this task graph log. * @return createdBy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the user who created this task graph log.") - public String getCreatedBy() { return createdBy; } - public TaskGraphLog name(String name) { - this.name = name; return this; } - /** + /** * A name for this task graph log, displayed in the UI. Does not need to be unique. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A name for this task graph log, displayed in the UI. Does not need to be unique. ") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** + /** * The date/time when this task graph log was originally created. This is distinct from the execution start_time. * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The date/time when this task graph log was originally created. This is distinct from the execution start_time. ") - public OffsetDateTime getCreatedAt() { return createdAt; } - - /** + /** * The start time of the task graph, recorded when the server starts executing the first node. * @return startTime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The start time of the task graph, recorded when the server starts executing the first node. ") - public OffsetDateTime getStartTime() { return startTime; } - - /** + /** * The end time of the task graph, recorded when the client reports completion. * @return endTime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The end time of the task graph, recorded when the client reports completion. ") - public OffsetDateTime getEndTime() { return endTime; } - public TaskGraphLog status(TaskGraphLogStatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TaskGraphLogStatus getStatus() { return status; } - public void setStatus(TaskGraphLogStatus status) { this.status = status; } public TaskGraphLog totalCost(BigDecimal totalCost) { - this.totalCost = totalCost; return this; } - /** + /** * If present, the total cost of executing all nodes in this task graph. * @return totalCost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If present, the total cost of executing all nodes in this task graph. ") - public BigDecimal getTotalCost() { return totalCost; } - public void setTotalCost(BigDecimal totalCost) { this.totalCost = totalCost; } public TaskGraphLog accessCost(BigDecimal accessCost) { - this.accessCost = accessCost; return this; } - /** + /** * If present, the total cost of access from execution of the nodes in this task graph. * @return accessCost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If present, the total cost of access from execution of the nodes in this task graph. ") - public BigDecimal getAccessCost() { return accessCost; } - public void setAccessCost(BigDecimal accessCost) { this.accessCost = accessCost; } public TaskGraphLog egressCost(BigDecimal egressCost) { - this.egressCost = egressCost; return this; } - /** + /** * If present, the total cost of access from execution of the nodes in this task graph. * @return egressCost - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If present, the total cost of access from execution of the nodes in this task graph. ") - public BigDecimal getEgressCost() { return egressCost; } - public void setEgressCost(BigDecimal egressCost) { this.egressCost = egressCost; } public TaskGraphLog executionTime(String executionTime) { - this.executionTime = executionTime; return this; } - /** + /** * The total execution time of all the nodes in this graph, in ISO 8601 format with hours, minutes, and seconds. * @return executionTime - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "P15H22M0.45S", value = "The total execution time of all the nodes in this graph, in ISO 8601 format with hours, minutes, and seconds. ") - public String getExecutionTime() { return executionTime; } - public void setExecutionTime(String executionTime) { this.executionTime = executionTime; } public TaskGraphLog statusCount(Map statusCount) { - this.statusCount = statusCount; return this; } @@ -395,25 +360,21 @@ public TaskGraphLog putStatusCountItem(String key, BigDecimal statusCountItem) { return this; } - /** + /** * A mapping from `ArrayTaskStatus` string value to the number of nodes in this graph that are in that status. * @return statusCount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A mapping from `ArrayTaskStatus` string value to the number of nodes in this graph that are in that status. ") - public Map getStatusCount() { return statusCount; } - public void setStatusCount(Map statusCount) { this.statusCount = statusCount; } public TaskGraphLog nodes(List nodes) { - this.nodes = nodes; return this; } @@ -426,140 +387,116 @@ public TaskGraphLog addNodesItem(TaskGraphNodeMetadata nodesItem) { return this; } - /** + /** * The structure of the graph. This is provided by the client when first setting up the task graph. Thereafter, it is read-only. This must be topographically sorted; that is, each node must appear after all nodes that it depends upon. * @return nodes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The structure of the graph. This is provided by the client when first setting up the task graph. Thereafter, it is read-only. This must be topographically sorted; that is, each node must appear after all nodes that it depends upon. ") - public List getNodes() { return nodes; } - public void setNodes(List nodes) { this.nodes = nodes; } public TaskGraphLog taskGraphType(TaskGraphType taskGraphType) { - this.taskGraphType = taskGraphType; return this; } - /** + /** * Get taskGraphType * @return taskGraphType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TaskGraphType getTaskGraphType() { return taskGraphType; } - public void setTaskGraphType(TaskGraphType taskGraphType) { this.taskGraphType = taskGraphType; } public TaskGraphLog taskGraphId(String taskGraphId) { - this.taskGraphId = taskGraphId; return this; } - /** + /** * The UUID of the task graph. * @return taskGraphId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The UUID of the task graph.") - public String getTaskGraphId() { return taskGraphId; } - public void setTaskGraphId(String taskGraphId) { this.taskGraphId = taskGraphId; } public TaskGraphLog cloudProvider(String cloudProvider) { - this.cloudProvider = cloudProvider; return this; } - /** + /** * The name of the cloud provider where this task graph executed. * @return cloudProvider - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the cloud provider where this task graph executed.") - public String getCloudProvider() { return cloudProvider; } - public void setCloudProvider(String cloudProvider) { this.cloudProvider = cloudProvider; } public TaskGraphLog cloudRegion(String cloudRegion) { - this.cloudRegion = cloudRegion; return this; } - /** + /** * The region of the cloud provider where this task graph executed. * @return cloudRegion - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The region of the cloud provider where this task graph executed.") - public String getCloudRegion() { return cloudRegion; } - public void setCloudRegion(String cloudRegion) { this.cloudRegion = cloudRegion; } public TaskGraphLog rootTaskGraphUuid(String rootTaskGraphUuid) { - this.rootTaskGraphUuid = rootTaskGraphUuid; return this; } - /** + /** * The UUID of the root taskgraph that this taskgraph is related to. This is used to provide consistent tracking and UI view for graphs that are executed by a set of taskgraphs. * @return rootTaskGraphUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The UUID of the root taskgraph that this taskgraph is related to. This is used to provide consistent tracking and UI view for graphs that are executed by a set of taskgraphs. ") - public String getRootTaskGraphUuid() { return rootTaskGraphUuid; } - public void setRootTaskGraphUuid(String rootTaskGraphUuid) { this.rootTaskGraphUuid = rootTaskGraphUuid; } public TaskGraphLog childrenTaskGraphUuids(List childrenTaskGraphUuids) { - this.childrenTaskGraphUuids = childrenTaskGraphUuids; return this; } @@ -572,57 +509,19 @@ public TaskGraphLog addChildrenTaskGraphUuidsItem(String childrenTaskGraphUuidsI return this; } - /** + /** * If this is a root taskgraph, this contains the list of all its children taskgraph UUIDs. * @return childrenTaskGraphUuids - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If this is a root taskgraph, this contains the list of all its children taskgraph UUIDs. ") - public List getChildrenTaskGraphUuids() { return childrenTaskGraphUuids; } - public void setChildrenTaskGraphUuids(List childrenTaskGraphUuids) { this.childrenTaskGraphUuids = childrenTaskGraphUuids; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphLog putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -653,8 +552,7 @@ public boolean equals(Object o) { Objects.equals(this.cloudProvider, taskGraphLog.cloudProvider) && Objects.equals(this.cloudRegion, taskGraphLog.cloudRegion) && Objects.equals(this.rootTaskGraphUuid, taskGraphLog.rootTaskGraphUuid) && - Objects.equals(this.childrenTaskGraphUuids, taskGraphLog.childrenTaskGraphUuids)&& - Objects.equals(this.additionalProperties, taskGraphLog.additionalProperties); + Objects.equals(this.childrenTaskGraphUuids, taskGraphLog.childrenTaskGraphUuids); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -663,7 +561,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(uuid, namespace, createdBy, name, createdAt, startTime, endTime, status, totalCost, accessCost, egressCost, executionTime, statusCount, nodes, taskGraphType, taskGraphId, cloudProvider, cloudRegion, rootTaskGraphUuid, childrenTaskGraphUuids, additionalProperties); + return Objects.hash(uuid, namespace, createdBy, name, createdAt, startTime, endTime, status, totalCost, accessCost, egressCost, executionTime, statusCount, nodes, taskGraphType, taskGraphId, cloudProvider, cloudRegion, rootTaskGraphUuid, childrenTaskGraphUuids); } private static int hashCodeNullable(JsonNullable a) { @@ -697,7 +595,6 @@ public String toString() { sb.append(" cloudRegion: ").append(toIndentedString(cloudRegion)).append("\n"); sb.append(" rootTaskGraphUuid: ").append(toIndentedString(rootTaskGraphUuid)).append("\n"); sb.append(" childrenTaskGraphUuids: ").append(toIndentedString(childrenTaskGraphUuids)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -745,20 +642,80 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphLog - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphLog.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphLog is not found in the empty JSON string", TaskGraphLog.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); + } + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + if ((jsonObj.get("created_by") != null && !jsonObj.get("created_by").isJsonNull()) && !jsonObj.get("created_by").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_by").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())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + TaskGraphLogStatus.validateJsonElement(jsonObj.get("status")); + } + if ((jsonObj.get("execution_time") != null && !jsonObj.get("execution_time").isJsonNull()) && !jsonObj.get("execution_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `execution_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("execution_time").toString())); + } + if (jsonObj.get("nodes") != null && !jsonObj.get("nodes").isJsonNull()) { + JsonArray jsonArraynodes = jsonObj.getAsJsonArray("nodes"); + if (jsonArraynodes != null) { + // ensure the json data is an array + if (!jsonObj.get("nodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodes` to be an array in the JSON string but got `%s`", jsonObj.get("nodes").toString())); + } + + // validate the optional field `nodes` (array) + for (int i = 0; i < jsonArraynodes.size(); i++) { + TaskGraphNodeMetadata.validateJsonElement(jsonArraynodes.get(i)); + }; + } + } + // validate the optional field `task_graph_type` + if (jsonObj.get("task_graph_type") != null && !jsonObj.get("task_graph_type").isJsonNull()) { + TaskGraphType.validateJsonElement(jsonObj.get("task_graph_type")); + } + if ((jsonObj.get("task_graph_id") != null && !jsonObj.get("task_graph_id").isJsonNull()) && !jsonObj.get("task_graph_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_graph_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_graph_id").toString())); + } + if ((jsonObj.get("cloud_provider") != null && !jsonObj.get("cloud_provider").isJsonNull()) && !jsonObj.get("cloud_provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cloud_provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cloud_provider").toString())); + } + if ((jsonObj.get("cloud_region") != null && !jsonObj.get("cloud_region").isJsonNull()) && !jsonObj.get("cloud_region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cloud_region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cloud_region").toString())); + } + if ((jsonObj.get("root_task_graph_uuid") != null && !jsonObj.get("root_task_graph_uuid").isJsonNull()) && !jsonObj.get("root_task_graph_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `root_task_graph_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("root_task_graph_uuid").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("children_task_graph_uuids") != null && !jsonObj.get("children_task_graph_uuids").isJsonNull() && !jsonObj.get("children_task_graph_uuids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `children_task_graph_uuids` to be an array in the JSON string but got `%s`", jsonObj.get("children_task_graph_uuids").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -776,71 +733,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphLog value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphLog read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphLog instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphLog - * @throws IOException if the JSON string is invalid with respect to TaskGraphLog - */ + /** + * Create an instance of TaskGraphLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphLog + * @throws IOException if the JSON string is invalid with respect to TaskGraphLog + */ public static TaskGraphLog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphLog.class); } - /** - * Convert an instance of TaskGraphLog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphLog 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/model/TaskGraphLogRunLocation.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocation.java index dc2a1c3..af62457 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocation.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocation.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public TaskGraphLogRunLocation read(final JsonReader jsonReader) throws IOExcept return TaskGraphLogRunLocation.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskGraphLogRunLocation.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatus.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatus.java index 4f47078..243f554 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatus.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatus.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -78,5 +79,10 @@ public TaskGraphLogStatus read(final JsonReader jsonReader) throws IOException { return TaskGraphLogStatus.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskGraphLogStatus.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsData.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsData.java index 41c32ea..34d7e55 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsData.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import io.tiledb.cloud.rest_api.model.TaskGraphLog; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,22 +53,20 @@ /** * Response data for a task graph list, including pagination metadata. */ -@ApiModel(description = "Response data for a task graph list, including pagination metadata.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphLogsData { public static final String SERIALIZED_NAME_TASK_GRAPH_LOGS = "task_graph_logs"; @SerializedName(SERIALIZED_NAME_TASK_GRAPH_LOGS) - private List taskGraphLogs = null; + private List taskGraphLogs = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public TaskGraphLogsData() { + public TaskGraphLogsData() { } public TaskGraphLogsData taskGraphLogs(List taskGraphLogs) { - this.taskGraphLogs = taskGraphLogs; return this; } @@ -72,80 +79,38 @@ public TaskGraphLogsData addTaskGraphLogsItem(TaskGraphLog taskGraphLogsItem) { return this; } - /** + /** * The requested task graph logs. * @return taskGraphLogs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The requested task graph logs.") - public List getTaskGraphLogs() { return taskGraphLogs; } - public void setTaskGraphLogs(List taskGraphLogs) { this.taskGraphLogs = taskGraphLogs; } public TaskGraphLogsData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphLogsData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } TaskGraphLogsData taskGraphLogsData = (TaskGraphLogsData) o; return Objects.equals(this.taskGraphLogs, taskGraphLogsData.taskGraphLogs) && - Objects.equals(this.paginationMetadata, taskGraphLogsData.paginationMetadata)&& - Objects.equals(this.additionalProperties, taskGraphLogsData.additionalProperties); + Objects.equals(this.paginationMetadata, taskGraphLogsData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(taskGraphLogs, paginationMetadata, additionalProperties); + return Objects.hash(taskGraphLogs, paginationMetadata); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class TaskGraphLogsData {\n"); sb.append(" taskGraphLogs: ").append(toIndentedString(taskGraphLogs)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,20 +166,45 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphLogsData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphLogsData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphLogsData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphLogsData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphLogsData is not found in the empty JSON string", TaskGraphLogsData.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphLogsData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphLogsData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("task_graph_logs") != null && !jsonObj.get("task_graph_logs").isJsonNull()) { + JsonArray jsonArraytaskGraphLogs = jsonObj.getAsJsonArray("task_graph_logs"); + if (jsonArraytaskGraphLogs != null) { + // ensure the json data is an array + if (!jsonObj.get("task_graph_logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `task_graph_logs` to be an array in the JSON string but got `%s`", jsonObj.get("task_graph_logs").toString())); + } + + // validate the optional field `task_graph_logs` (array) + for (int i = 0; i < jsonArraytaskGraphLogs.size(); i++) { + TaskGraphLog.validateJsonElement(jsonArraytaskGraphLogs.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 { @@ -234,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphLogsData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphLogsData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphLogsData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphLogsData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphLogsData - * @throws IOException if the JSON string is invalid with respect to TaskGraphLogsData - */ + /** + * Create an instance of TaskGraphLogsData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphLogsData + * @throws IOException if the JSON string is invalid with respect to TaskGraphLogsData + */ public static TaskGraphLogsData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphLogsData.class); } - /** - * Convert an instance of TaskGraphLogsData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphLogsData 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/model/TaskGraphNode.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphNode.java index db85045..34b9d31 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphNode.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphNode.java @@ -14,38 +14,50 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.RetryStrategy; +import io.tiledb.cloud.rest_api.model.TGInputNodeData; +import io.tiledb.cloud.rest_api.model.TGSQLNodeData; +import io.tiledb.cloud.rest_api.model.TGUDFNodeData; +import io.tiledb.cloud.rest_api.model.UDFArrayDetails; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Information about a single node within a registered task graph. A single node represents one piece of data or a computational step; either as an input value, a data source, or a computation that acts upon earlier nodes. The structure parallels the existing `TaskGraphNodeMetadata`. */ -@ApiModel(description = "Information about a single node within a registered task graph. A single node represents one piece of data or a computational step; either as an input value, a data source, or a computation that acts upon earlier nodes. The structure parallels the existing `TaskGraphNodeMetadata`. ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphNode { public static final String SERIALIZED_NAME_CLIENT_NODE_ID = "client_node_id"; @SerializedName(SERIALIZED_NAME_CLIENT_NODE_ID) @@ -57,7 +69,7 @@ public class TaskGraphNode { public static final String SERIALIZED_NAME_DEPENDS_ON = "depends_on"; @SerializedName(SERIALIZED_NAME_DEPENDS_ON) - private List dependsOn = null; + private List dependsOn = new ArrayList<>(); public static final String SERIALIZED_NAME_ARRAY_NODE = "array_node"; @SerializedName(SERIALIZED_NAME_ARRAY_NODE) @@ -87,57 +99,48 @@ public class TaskGraphNode { @SerializedName(SERIALIZED_NAME_DEADLINE) private Long deadline; - public TaskGraphNode() { + public TaskGraphNode() { } public TaskGraphNode clientNodeId(String clientNodeId) { - this.clientNodeId = clientNodeId; return this; } - /** + /** * The client-generated UUID of the given graph node. * @return clientNodeId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client-generated UUID of the given graph node.") - public String getClientNodeId() { return clientNodeId; } - public void setClientNodeId(String clientNodeId) { this.clientNodeId = clientNodeId; } public TaskGraphNode name(String name) { - this.name = name; return this; } - /** + /** * A client-specified name for the node. If provided, this must be unique. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A client-specified name for the node. If provided, this must be unique. ") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public TaskGraphNode dependsOn(List dependsOn) { - this.dependsOn = dependsOn; return this; } @@ -150,218 +153,152 @@ public TaskGraphNode addDependsOnItem(String dependsOnItem) { return this; } - /** + /** * The client_node_uuid of each node that this node depends upon. Used to define the structure of the graph. * @return dependsOn - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client_node_uuid of each node that this node depends upon. Used to define the structure of the graph. ") - public List getDependsOn() { return dependsOn; } - public void setDependsOn(List dependsOn) { this.dependsOn = dependsOn; } public TaskGraphNode arrayNode(UDFArrayDetails arrayNode) { - this.arrayNode = arrayNode; return this; } - /** + /** * Get arrayNode * @return arrayNode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFArrayDetails getArrayNode() { return arrayNode; } - public void setArrayNode(UDFArrayDetails arrayNode) { this.arrayNode = arrayNode; } public TaskGraphNode inputNode(TGInputNodeData inputNode) { - this.inputNode = inputNode; return this; } - /** + /** * Get inputNode * @return inputNode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TGInputNodeData getInputNode() { return inputNode; } - public void setInputNode(TGInputNodeData inputNode) { this.inputNode = inputNode; } public TaskGraphNode sqlNode(TGSQLNodeData sqlNode) { - this.sqlNode = sqlNode; return this; } - /** + /** * Get sqlNode * @return sqlNode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TGSQLNodeData getSqlNode() { return sqlNode; } - public void setSqlNode(TGSQLNodeData sqlNode) { this.sqlNode = sqlNode; } public TaskGraphNode udfNode(TGUDFNodeData udfNode) { - this.udfNode = udfNode; return this; } - /** + /** * Get udfNode * @return udfNode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TGUDFNodeData getUdfNode() { return udfNode; } - public void setUdfNode(TGUDFNodeData udfNode) { this.udfNode = udfNode; } public TaskGraphNode retryStrategy(RetryStrategy retryStrategy) { - this.retryStrategy = retryStrategy; return this; } - /** + /** * Get retryStrategy * @return retryStrategy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public RetryStrategy getRetryStrategy() { return retryStrategy; } - public void setRetryStrategy(RetryStrategy retryStrategy) { this.retryStrategy = retryStrategy; } public TaskGraphNode expandNodeOutput(String expandNodeOutput) { - this.expandNodeOutput = expandNodeOutput; return this; } - /** + /** * Used to create dynamic tasks based on the output of another node. The other node's output must be a JSON list of values. The expansion process creates one task per item in the output list. The item is also passed as an argument to each task. The value is the client_node_uuid of the node that we want to expand. * @return expandNodeOutput - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Used to create dynamic tasks based on the output of another node. The other node's output must be a JSON list of values. The expansion process creates one task per item in the output list. The item is also passed as an argument to each task. The value is the client_node_uuid of the node that we want to expand. ") - public String getExpandNodeOutput() { return expandNodeOutput; } - public void setExpandNodeOutput(String expandNodeOutput) { this.expandNodeOutput = expandNodeOutput; } public TaskGraphNode deadline(Long deadline) { - this.deadline = deadline; return this; } - /** + /** * Duration in seconds relative to the node start time which the node is allowed to run before it gets terminated. * @return deadline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Duration in seconds relative to the node start time which the node is allowed to run before it gets terminated. ") - public Long getDeadline() { return deadline; } - public void setDeadline(Long deadline) { this.deadline = deadline; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphNode putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -382,8 +319,7 @@ public boolean equals(Object o) { Objects.equals(this.udfNode, taskGraphNode.udfNode) && Objects.equals(this.retryStrategy, taskGraphNode.retryStrategy) && Objects.equals(this.expandNodeOutput, taskGraphNode.expandNodeOutput) && - Objects.equals(this.deadline, taskGraphNode.deadline)&& - Objects.equals(this.additionalProperties, taskGraphNode.additionalProperties); + Objects.equals(this.deadline, taskGraphNode.deadline); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -392,7 +328,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(clientNodeId, name, dependsOn, arrayNode, inputNode, sqlNode, udfNode, retryStrategy, expandNodeOutput, deadline, additionalProperties); + return Objects.hash(clientNodeId, name, dependsOn, arrayNode, inputNode, sqlNode, udfNode, retryStrategy, expandNodeOutput, deadline); } private static int hashCodeNullable(JsonNullable a) { @@ -416,7 +352,6 @@ public String toString() { sb.append(" retryStrategy: ").append(toIndentedString(retryStrategy)).append("\n"); sb.append(" expandNodeOutput: ").append(toIndentedString(expandNodeOutput)).append("\n"); sb.append(" deadline: ").append(toIndentedString(deadline)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -454,20 +389,60 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphNode - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphNode.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphNode + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphNode.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphNode is not found in the empty JSON string", TaskGraphNode.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphNode.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphNode` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("client_node_id") != null && !jsonObj.get("client_node_id").isJsonNull()) && !jsonObj.get("client_node_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_node_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("depends_on") != null && !jsonObj.get("depends_on").isJsonNull() && !jsonObj.get("depends_on").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `depends_on` to be an array in the JSON string but got `%s`", jsonObj.get("depends_on").toString())); + } + // validate the optional field `array_node` + if (jsonObj.get("array_node") != null && !jsonObj.get("array_node").isJsonNull()) { + UDFArrayDetails.validateJsonElement(jsonObj.get("array_node")); + } + // validate the optional field `input_node` + if (jsonObj.get("input_node") != null && !jsonObj.get("input_node").isJsonNull()) { + TGInputNodeData.validateJsonElement(jsonObj.get("input_node")); + } + // validate the optional field `sql_node` + if (jsonObj.get("sql_node") != null && !jsonObj.get("sql_node").isJsonNull()) { + TGSQLNodeData.validateJsonElement(jsonObj.get("sql_node")); + } + // validate the optional field `udf_node` + if (jsonObj.get("udf_node") != null && !jsonObj.get("udf_node").isJsonNull()) { + TGUDFNodeData.validateJsonElement(jsonObj.get("udf_node")); + } + // validate the optional field `retry_strategy` + if (jsonObj.get("retry_strategy") != null && !jsonObj.get("retry_strategy").isJsonNull()) { + RetryStrategy.validateJsonElement(jsonObj.get("retry_strategy")); + } + if ((jsonObj.get("expand_node_output") != null && !jsonObj.get("expand_node_output").isJsonNull()) && !jsonObj.get("expand_node_output").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expand_node_output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expand_node_output").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -485,71 +460,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphNode value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphNode read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphNode instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphNode given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphNode - * @throws IOException if the JSON string is invalid with respect to TaskGraphNode - */ + /** + * Create an instance of TaskGraphNode given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphNode + * @throws IOException if the JSON string is invalid with respect to TaskGraphNode + */ public static TaskGraphNode fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphNode.class); } - /** - * Convert an instance of TaskGraphNode to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphNode 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/model/TaskGraphNodeMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadata.java index a20f953..17de8a6 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadata.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadata.java @@ -14,31 +14,40 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayTask; +import io.tiledb.cloud.rest_api.model.ArrayTaskStatus; +import io.tiledb.cloud.rest_api.model.TaskGraphLogRunLocation; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -46,8 +55,7 @@ /** * Metadata about an individual node in a task graph. */ -@ApiModel(description = "Metadata about an individual node in a task graph.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphNodeMetadata { public static final String SERIALIZED_NAME_CLIENT_NODE_UUID = "client_node_uuid"; @SerializedName(SERIALIZED_NAME_CLIENT_NODE_UUID) @@ -59,7 +67,7 @@ public class TaskGraphNodeMetadata { public static final String SERIALIZED_NAME_DEPENDS_ON = "depends_on"; @SerializedName(SERIALIZED_NAME_DEPENDS_ON) - private List dependsOn = null; + private List dependsOn = new ArrayList<>(); public static final String SERIALIZED_NAME_RUN_LOCATION = "run_location"; @SerializedName(SERIALIZED_NAME_RUN_LOCATION) @@ -75,12 +83,11 @@ public class TaskGraphNodeMetadata { public static final String SERIALIZED_NAME_EXECUTIONS = "executions"; @SerializedName(SERIALIZED_NAME_EXECUTIONS) - private List executions = null; + private List executions = new ArrayList<>(); - public TaskGraphNodeMetadata() { + public TaskGraphNodeMetadata() { } - public TaskGraphNodeMetadata( List executions ) { @@ -89,53 +96,44 @@ public TaskGraphNodeMetadata( } public TaskGraphNodeMetadata clientNodeUuid(String clientNodeUuid) { - this.clientNodeUuid = clientNodeUuid; return this; } - /** + /** * The client-generated UUID of the given graph node. * @return clientNodeUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client-generated UUID of the given graph node.") - public String getClientNodeUuid() { return clientNodeUuid; } - public void setClientNodeUuid(String clientNodeUuid) { this.clientNodeUuid = clientNodeUuid; } public TaskGraphNodeMetadata name(String name) { - this.name = name; return this; } - /** + /** * The client-generated name of the node. This is not guaranteed to be unique. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client-generated name of the node. This is not guaranteed to be unique. ") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public TaskGraphNodeMetadata dependsOn(List dependsOn) { - this.dependsOn = dependsOn; return this; } @@ -148,141 +146,88 @@ public TaskGraphNodeMetadata addDependsOnItem(String dependsOnItem) { return this; } - /** + /** * The client_node_uuid of each node that this node depends upon. Used to define the structure of the graph. * @return dependsOn - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client_node_uuid of each node that this node depends upon. Used to define the structure of the graph. ") - public List getDependsOn() { return dependsOn; } - public void setDependsOn(List dependsOn) { this.dependsOn = dependsOn; } public TaskGraphNodeMetadata runLocation(TaskGraphLogRunLocation runLocation) { - this.runLocation = runLocation; return this; } - /** + /** * Get runLocation * @return runLocation - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public TaskGraphLogRunLocation getRunLocation() { return runLocation; } - public void setRunLocation(TaskGraphLogRunLocation runLocation) { this.runLocation = runLocation; } public TaskGraphNodeMetadata status(ArrayTaskStatus status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ArrayTaskStatus getStatus() { return status; } - public void setStatus(ArrayTaskStatus status) { this.status = status; } public TaskGraphNodeMetadata statusMessage(String statusMessage) { - this.statusMessage = statusMessage; return this; } - /** + /** * The reason the array task status is in the state * @return statusMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The reason the array task status is in the state") - public String getStatusMessage() { return statusMessage; } - public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } - /** + /** * ArrayTasks representing each execution attempt for this node. For nodes that have never been submitted, this will be empty. For nodes that have been retried, this may have multiple entries. The last one in the list represents the most recent execution. This is read-only and generated by the server based on the tasks it has actually executed. * @return executions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "ArrayTasks representing each execution attempt for this node. For nodes that have never been submitted, this will be empty. For nodes that have been retried, this may have multiple entries. The last one in the list represents the most recent execution. This is read-only and generated by the server based on the tasks it has actually executed. ") - public List getExecutions() { return executions; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphNodeMetadata putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - @Override public boolean equals(Object o) { @@ -299,8 +244,7 @@ public boolean equals(Object o) { Objects.equals(this.runLocation, taskGraphNodeMetadata.runLocation) && Objects.equals(this.status, taskGraphNodeMetadata.status) && Objects.equals(this.statusMessage, taskGraphNodeMetadata.statusMessage) && - Objects.equals(this.executions, taskGraphNodeMetadata.executions)&& - Objects.equals(this.additionalProperties, taskGraphNodeMetadata.additionalProperties); + Objects.equals(this.executions, taskGraphNodeMetadata.executions); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -309,7 +253,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(clientNodeUuid, name, dependsOn, runLocation, status, statusMessage, executions, additionalProperties); + return Objects.hash(clientNodeUuid, name, dependsOn, runLocation, status, statusMessage, executions); } private static int hashCodeNullable(JsonNullable a) { @@ -330,7 +274,6 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" statusMessage: ").append(toIndentedString(statusMessage)).append("\n"); sb.append(" executions: ").append(toIndentedString(executions)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -365,20 +308,62 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphNodeMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphNodeMetadata.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphNodeMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphNodeMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphNodeMetadata is not found in the empty JSON string", TaskGraphNodeMetadata.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphNodeMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphNodeMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("client_node_uuid") != null && !jsonObj.get("client_node_uuid").isJsonNull()) && !jsonObj.get("client_node_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_node_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_node_uuid").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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("depends_on") != null && !jsonObj.get("depends_on").isJsonNull() && !jsonObj.get("depends_on").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `depends_on` to be an array in the JSON string but got `%s`", jsonObj.get("depends_on").toString())); + } + // validate the optional field `run_location` + if (jsonObj.get("run_location") != null && !jsonObj.get("run_location").isJsonNull()) { + TaskGraphLogRunLocation.validateJsonElement(jsonObj.get("run_location")); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + ArrayTaskStatus.validateJsonElement(jsonObj.get("status")); + } + if ((jsonObj.get("status_message") != null && !jsonObj.get("status_message").isJsonNull()) && !jsonObj.get("status_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status_message").toString())); + } + if (jsonObj.get("executions") != null && !jsonObj.get("executions").isJsonNull()) { + JsonArray jsonArrayexecutions = jsonObj.getAsJsonArray("executions"); + if (jsonArrayexecutions != null) { + // ensure the json data is an array + if (!jsonObj.get("executions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `executions` to be an array in the JSON string but got `%s`", jsonObj.get("executions").toString())); + } + + // validate the optional field `executions` (array) + for (int i = 0; i < jsonArrayexecutions.size(); i++) { + ArrayTask.validateJsonElement(jsonArrayexecutions.get(i)); + }; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -396,71 +381,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphNodeMetadata value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphNodeMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphNodeMetadata instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphNodeMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphNodeMetadata - * @throws IOException if the JSON string is invalid with respect to TaskGraphNodeMetadata - */ + /** + * Create an instance of TaskGraphNodeMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphNodeMetadata + * @throws IOException if the JSON string is invalid with respect to TaskGraphNodeMetadata + */ public static TaskGraphNodeMetadata fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphNodeMetadata.class); } - /** - * Convert an instance of TaskGraphNodeMetadata to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphNodeMetadata 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/model/TaskGraphSharing.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphSharing.java index 4e661eb..d6f4640 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphSharing.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphSharing.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TaskGraphActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,12 +52,11 @@ /** * details for sharing a given registered task graph */ -@ApiModel(description = "details for sharing a given registered task graph") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphSharing { public static final String SERIALIZED_NAME_ACTIONS = "actions"; @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = null; + private List actions = new ArrayList<>(); public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -58,11 +66,10 @@ public class TaskGraphSharing { @SerializedName(SERIALIZED_NAME_NAMESPACE_TYPE) private String namespaceType; - public TaskGraphSharing() { + public TaskGraphSharing() { } public TaskGraphSharing actions(List actions) { - this.actions = actions; return this; } @@ -75,103 +82,57 @@ public TaskGraphSharing addActionsItem(TaskGraphActions actionsItem) { return this; } - /** + /** * List of permitted actions * @return actions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[fetch_task_graph, share_task_graph]", value = "List of permitted actions") - public List getActions() { return actions; } - public void setActions(List actions) { this.actions = actions; } public TaskGraphSharing namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace being granted array access can be a user or organization * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "MyOrganization", value = "namespace being granted array access can be a user or organization") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public TaskGraphSharing namespaceType(String namespaceType) { - this.namespaceType = namespaceType; return this; } - /** + /** * details on if the namespace is a organization or user * @return namespaceType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "organization", value = "details on if the namespace is a organization or user") - public String getNamespaceType() { return namespaceType; } - public void setNamespaceType(String namespaceType) { this.namespaceType = namespaceType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphSharing putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -185,13 +146,12 @@ public boolean equals(Object o) { TaskGraphSharing taskGraphSharing = (TaskGraphSharing) o; return Objects.equals(this.actions, taskGraphSharing.actions) && Objects.equals(this.namespace, taskGraphSharing.namespace) && - Objects.equals(this.namespaceType, taskGraphSharing.namespaceType)&& - Objects.equals(this.additionalProperties, taskGraphSharing.additionalProperties); + Objects.equals(this.namespaceType, taskGraphSharing.namespaceType); } @Override public int hashCode() { - return Objects.hash(actions, namespace, namespaceType, additionalProperties); + return Objects.hash(actions, namespace, namespaceType); } @Override @@ -201,7 +161,6 @@ public String toString() { sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" namespaceType: ").append(toIndentedString(namespaceType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -232,28 +191,35 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphSharing - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphSharing.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphSharing + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphSharing.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphSharing is not found in the empty JSON string", TaskGraphSharing.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphSharing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphSharing` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonNull() && !jsonObj.get("actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonPrimitive()) { + if ((jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonNull()) && !jsonObj.get("namespace_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_type").toString())); } } @@ -273,71 +239,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphSharing value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphSharing read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphSharing instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphSharing given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphSharing - * @throws IOException if the JSON string is invalid with respect to TaskGraphSharing - */ + /** + * Create an instance of TaskGraphSharing given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphSharing + * @throws IOException if the JSON string is invalid with respect to TaskGraphSharing + */ public static TaskGraphSharing fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphSharing.class); } - /** - * Convert an instance of TaskGraphSharing to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphSharing 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/model/TaskGraphType.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphType.java index 2f1ee48..413a391 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public TaskGraphType read(final JsonReader jsonReader) throws IOException { return TaskGraphType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskGraphType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphs.java b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphs.java index eac77d3..6910b39 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphs.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TaskGraphs.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TaskGraph; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,18 +52,16 @@ /** * Information about a series of task graphs. */ -@ApiModel(description = "Information about a series of task graphs.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TaskGraphs { public static final String SERIALIZED_NAME_GRAPHS = "graphs"; @SerializedName(SERIALIZED_NAME_GRAPHS) - private List graphs = null; + private List graphs = new ArrayList<>(); - public TaskGraphs() { + public TaskGraphs() { } public TaskGraphs graphs(List graphs) { - this.graphs = graphs; return this; } @@ -68,57 +74,19 @@ public TaskGraphs addGraphsItem(TaskGraph graphsItem) { return this; } - /** + /** * The series of graphs. * @return graphs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The series of graphs. ") - public List getGraphs() { return graphs; } - public void setGraphs(List graphs) { this.graphs = graphs; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TaskGraphs putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -130,13 +98,12 @@ public boolean equals(Object o) { return false; } TaskGraphs taskGraphs = (TaskGraphs) o; - return Objects.equals(this.graphs, taskGraphs.graphs)&& - Objects.equals(this.additionalProperties, taskGraphs.additionalProperties); + return Objects.equals(this.graphs, taskGraphs.graphs); } @Override public int hashCode() { - return Objects.hash(graphs, additionalProperties); + return Objects.hash(graphs); } @Override @@ -144,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TaskGraphs {\n"); sb.append(" graphs: ").append(toIndentedString(graphs)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -173,20 +139,41 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TaskGraphs - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TaskGraphs.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TaskGraphs + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TaskGraphs.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TaskGraphs is not found in the empty JSON string", TaskGraphs.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TaskGraphs.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaskGraphs` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("graphs") != null && !jsonObj.get("graphs").isJsonNull()) { + JsonArray jsonArraygraphs = jsonObj.getAsJsonArray("graphs"); + if (jsonArraygraphs != null) { + // ensure the json data is an array + if (!jsonObj.get("graphs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `graphs` to be an array in the JSON string but got `%s`", jsonObj.get("graphs").toString())); + } + + // validate the optional field `graphs` (array) + for (int i = 0; i < jsonArraygraphs.size(); i++) { + TaskGraph.validateJsonElement(jsonArraygraphs.get(i)); + }; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -204,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TaskGraphs value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TaskGraphs read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TaskGraphs instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TaskGraphs given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskGraphs - * @throws IOException if the JSON string is invalid with respect to TaskGraphs - */ + /** + * Create an instance of TaskGraphs given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskGraphs + * @throws IOException if the JSON string is invalid with respect to TaskGraphs + */ public static TaskGraphs fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskGraphs.class); } - /** - * Convert an instance of TaskGraphs to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskGraphs 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/model/TileDBConfig.java b/src/main/java/io/tiledb/cloud/rest_api/model/TileDBConfig.java index 1f543d9..057aee4 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TileDBConfig.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TileDBConfig.java @@ -14,29 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TileDBConfigEntriesInner; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,18 +52,16 @@ /** * TileDB config used for interaction with the embedded library */ -@ApiModel(description = "TileDB config used for interaction with the embedded library") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TileDBConfig { public static final String SERIALIZED_NAME_ENTRIES = "entries"; @SerializedName(SERIALIZED_NAME_ENTRIES) - private List entries = null; + private List entries = new ArrayList<>(); - public TileDBConfig() { + public TileDBConfig() { } public TileDBConfig entries(List entries) { - this.entries = entries; return this; } @@ -68,57 +74,19 @@ public TileDBConfig addEntriesItem(TileDBConfigEntriesInner entriesItem) { return this; } - /** + /** * Get entries * @return entries - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public List getEntries() { return entries; } - public void setEntries(List entries) { this.entries = entries; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TileDBConfig putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -130,13 +98,12 @@ public boolean equals(Object o) { return false; } TileDBConfig tileDBConfig = (TileDBConfig) o; - return Objects.equals(this.entries, tileDBConfig.entries)&& - Objects.equals(this.additionalProperties, tileDBConfig.additionalProperties); + return Objects.equals(this.entries, tileDBConfig.entries); } @Override public int hashCode() { - return Objects.hash(entries, additionalProperties); + return Objects.hash(entries); } @Override @@ -144,7 +111,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TileDBConfig {\n"); sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -173,31 +139,40 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TileDBConfig - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TileDBConfig.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TileDBConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TileDBConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TileDBConfig is not found in the empty JSON string", TileDBConfig.openapiRequiredFields.toString())); } } - JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); - if (jsonArrayentries != null) { - // ensure the json data is an array - 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())); - } - // validate the optional field `entries` (array) - for (int i = 0; i < jsonArrayentries.size(); i++) { - TileDBConfigEntriesInner.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TileDBConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TileDBConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("entries") != null && !jsonObj.get("entries").isJsonNull()) { + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + TileDBConfigEntriesInner.validateJsonElement(jsonArrayentries.get(i)); + }; + } } } @@ -216,71 +191,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TileDBConfig value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TileDBConfig read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TileDBConfig instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TileDBConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of TileDBConfig - * @throws IOException if the JSON string is invalid with respect to TileDBConfig - */ + /** + * Create an instance of TileDBConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of TileDBConfig + * @throws IOException if the JSON string is invalid with respect to TileDBConfig + */ public static TileDBConfig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TileDBConfig.class); } - /** - * Convert an instance of TileDBConfig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TileDBConfig 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/model/TileDBConfigEntriesInner.java b/src/main/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInner.java index ec29ae4..0237561 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInner.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInner.java @@ -14,32 +14,42 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * TileDBConfigEntriesInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TileDBConfigEntriesInner { public static final String SERIALIZED_NAME_KEY = "key"; @SerializedName(SERIALIZED_NAME_KEY) @@ -49,89 +59,46 @@ public class TileDBConfigEntriesInner { @SerializedName(SERIALIZED_NAME_VALUE) private String value; - public TileDBConfigEntriesInner() { + public TileDBConfigEntriesInner() { } public TileDBConfigEntriesInner key(String key) { - this.key = key; return this; } - /** + /** * Get key * @return key - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getKey() { return key; } - public void setKey(String key) { this.key = key; } public TileDBConfigEntriesInner value(String value) { - this.value = value; return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getValue() { return value; } - public void setValue(String value) { this.value = value; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TileDBConfigEntriesInner putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -144,13 +111,12 @@ public boolean equals(Object o) { } TileDBConfigEntriesInner tileDBConfigEntriesInner = (TileDBConfigEntriesInner) o; return Objects.equals(this.key, tileDBConfigEntriesInner.key) && - Objects.equals(this.value, tileDBConfigEntriesInner.value)&& - Objects.equals(this.additionalProperties, tileDBConfigEntriesInner.additionalProperties); + Objects.equals(this.value, tileDBConfigEntriesInner.value); } @Override public int hashCode() { - return Objects.hash(key, value, additionalProperties); + return Objects.hash(key, value); } @Override @@ -159,7 +125,6 @@ public String toString() { sb.append("class TileDBConfigEntriesInner {\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -189,24 +154,31 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TileDBConfigEntriesInner - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TileDBConfigEntriesInner.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TileDBConfigEntriesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TileDBConfigEntriesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TileDBConfigEntriesInner is not found in the empty JSON string", TileDBConfigEntriesInner.openapiRequiredFields.toString())); } } - if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TileDBConfigEntriesInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TileDBConfigEntriesInner` 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("value") != null && !jsonObj.get("value").isJsonPrimitive()) { + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !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())); } } @@ -226,71 +198,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TileDBConfigEntriesInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TileDBConfigEntriesInner read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TileDBConfigEntriesInner instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TileDBConfigEntriesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of TileDBConfigEntriesInner - * @throws IOException if the JSON string is invalid with respect to TileDBConfigEntriesInner - */ + /** + * Create an instance of TileDBConfigEntriesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of TileDBConfigEntriesInner + * @throws IOException if the JSON string is invalid with respect to TileDBConfigEntriesInner + */ public static TileDBConfigEntriesInner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TileDBConfigEntriesInner.class); } - /** - * Convert an instance of TileDBConfigEntriesInner to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TileDBConfigEntriesInner 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/model/Token.java b/src/main/java/io/tiledb/cloud/rest_api/model/Token.java index 27c1682..08da614 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Token.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Token.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TokenScope; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +53,7 @@ /** * A api token and its metadata */ -@ApiModel(description = "A api token and its metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Token { public static final String SERIALIZED_NAME_TOKEN = "token"; @SerializedName(SERIALIZED_NAME_TOKEN) @@ -65,105 +73,88 @@ public class Token { public static final String SERIALIZED_NAME_SCOPE = "scope"; @SerializedName(SERIALIZED_NAME_SCOPE) - private List scope = null; + private List scope = new ArrayList<>(); - public Token() { + public Token() { } public Token token(String token) { - this.token = token; return this; } - /** + /** * A api token * @return token - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A api token") - public String getToken() { return token; } - public void setToken(String token) { this.token = token; } public Token name(String name) { - this.name = name; return this; } - /** + /** * Name of token to revoke * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Name of token to revoke") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public Token issuedAt(OffsetDateTime issuedAt) { - this.issuedAt = issuedAt; return this; } - /** + /** * datetime the token was created * @return issuedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "datetime the token was created") - public OffsetDateTime getIssuedAt() { return issuedAt; } - public void setIssuedAt(OffsetDateTime issuedAt) { this.issuedAt = issuedAt; } public Token expiresAt(OffsetDateTime expiresAt) { - this.expiresAt = expiresAt; return this; } - /** + /** * datetime the token when token will expire * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "datetime the token when token will expire") - public OffsetDateTime getExpiresAt() { return expiresAt; } - public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; } public Token scope(List scope) { - this.scope = scope; return this; } @@ -176,57 +167,19 @@ public Token addScopeItem(TokenScope scopeItem) { return this; } - /** + /** * Optional scope to limit token, defaults to all permissions, current supported values are password_reset or * * @return scope - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional scope to limit token, defaults to all permissions, current supported values are password_reset or *") - public List getScope() { return scope; } - public void setScope(List scope) { this.scope = scope; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Token putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -242,13 +195,12 @@ public boolean equals(Object o) { Objects.equals(this.name, token.name) && Objects.equals(this.issuedAt, token.issuedAt) && Objects.equals(this.expiresAt, token.expiresAt) && - Objects.equals(this.scope, token.scope)&& - Objects.equals(this.additionalProperties, token.additionalProperties); + Objects.equals(this.scope, token.scope); } @Override public int hashCode() { - return Objects.hash(token, name, issuedAt, expiresAt, scope, additionalProperties); + return Objects.hash(token, name, issuedAt, expiresAt, scope); } @Override @@ -260,7 +212,6 @@ public String toString() { sb.append(" issuedAt: ").append(toIndentedString(issuedAt)).append("\n"); sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -293,28 +244,35 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Token - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Token.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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())); } } - if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonPrimitive()) { + + 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(); + if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) && !jsonObj.get("token").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } - // ensure the json data is an array - if (jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull() && !jsonObj.get("scope").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `scope` to be an array in the JSON string but got `%s`", jsonObj.get("scope").toString())); } } @@ -334,71 +292,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Token value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Token read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Token instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/TokenRequest.java b/src/main/java/io/tiledb/cloud/rest_api/model/TokenRequest.java index cbca569..78671c0 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TokenRequest.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TokenRequest.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.TokenScope; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +53,7 @@ /** * A request from a user for an api token */ -@ApiModel(description = "A request from a user for an api token") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class TokenRequest { public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) @@ -57,59 +65,50 @@ public class TokenRequest { public static final String SERIALIZED_NAME_SCOPE = "scope"; @SerializedName(SERIALIZED_NAME_SCOPE) - private List scope = null; + private List scope = new ArrayList<>(); - public TokenRequest() { + public TokenRequest() { } public TokenRequest expires(OffsetDateTime expires) { - this.expires = expires; return this; } - /** + /** * Expiration date for token, if empty token defaults to 30 minutes * @return expires - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "2018-12-31T12:13:14Z", value = "Expiration date for token, if empty token defaults to 30 minutes") - public OffsetDateTime getExpires() { return expires; } - public void setExpires(OffsetDateTime expires) { this.expires = expires; } public TokenRequest name(String name) { - this.name = name; return this; } - /** + /** * Optional name for token, if the name already exists for the user it will be auto incremented (i.e. myToken-1) * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "myToken", value = "Optional name for token, if the name already exists for the user it will be auto incremented (i.e. myToken-1)") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public TokenRequest scope(List scope) { - this.scope = scope; return this; } @@ -122,57 +121,19 @@ public TokenRequest addScopeItem(TokenScope scopeItem) { return this; } - /** + /** * Optional scope to limit token, defaults to all permissions, current supported values are password_reset or * * @return scope - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional scope to limit token, defaults to all permissions, current supported values are password_reset or *") - public List getScope() { return scope; } - public void setScope(List scope) { this.scope = scope; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public TokenRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -186,13 +147,12 @@ public boolean equals(Object o) { TokenRequest tokenRequest = (TokenRequest) o; return Objects.equals(this.expires, tokenRequest.expires) && Objects.equals(this.name, tokenRequest.name) && - Objects.equals(this.scope, tokenRequest.scope)&& - Objects.equals(this.additionalProperties, tokenRequest.additionalProperties); + Objects.equals(this.scope, tokenRequest.scope); } @Override public int hashCode() { - return Objects.hash(expires, name, scope, additionalProperties); + return Objects.hash(expires, name, scope); } @Override @@ -202,7 +162,6 @@ public String toString() { sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -233,25 +192,32 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TokenRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (TokenRequest.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 TokenRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TokenRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in TokenRequest is not found in the empty JSON string", TokenRequest.openapiRequiredFields.toString())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TokenRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TokenRequest` 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())); } - // ensure the json data is an array - if (jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull() && !jsonObj.get("scope").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `scope` to be an array in the JSON string but got `%s`", jsonObj.get("scope").toString())); } } @@ -271,71 +237,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, TokenRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public TokenRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - TokenRequest instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of TokenRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of TokenRequest - * @throws IOException if the JSON string is invalid with respect to TokenRequest - */ + /** + * Create an instance of TokenRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TokenRequest + * @throws IOException if the JSON string is invalid with respect to TokenRequest + */ public static TokenRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TokenRequest.class); } - /** - * Convert an instance of TokenRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TokenRequest 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/model/TokenScope.java b/src/main/java/io/tiledb/cloud/rest_api/model/TokenScope.java index 7671c88..52b8e24 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/TokenScope.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/TokenScope.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -94,5 +95,10 @@ public TokenScope read(final JsonReader jsonReader) throws IOException { 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/model/UDFActions.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFActions.java index 6b9b858..f027d9e 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFActions.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFActions.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -68,5 +69,10 @@ public UDFActions read(final JsonReader jsonReader) throws IOException { return UDFActions.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UDFActions.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/UDFArrayDetails.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFArrayDetails.java index 1bb3cb7..2212f1a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFArrayDetails.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFArrayDetails.java @@ -14,38 +14,46 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.QueryRanges; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Contains array details for multi-array query including uri, ranges buffers */ -@ApiModel(description = "Contains array details for multi-array query including uri, ranges buffers") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFArrayDetails { public static final String SERIALIZED_NAME_PARAMETER_ID = "parameter_id"; @SerializedName(SERIALIZED_NAME_PARAMETER_ID) @@ -61,82 +69,69 @@ public class UDFArrayDetails { public static final String SERIALIZED_NAME_BUFFERS = "buffers"; @SerializedName(SERIALIZED_NAME_BUFFERS) - private List buffers = null; + private List buffers = new ArrayList<>(); - public UDFArrayDetails() { + public UDFArrayDetails() { } public UDFArrayDetails parameterId(String parameterId) { - this.parameterId = parameterId; return this; } - /** + /** * An optional client-generated identifier to distinguish between multiple range/buffer requests from the same array in the same call. This may be set for MultiArrayUDFs that use the `argument_json` style of passing arrays. * @return parameterId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional client-generated identifier to distinguish between multiple range/buffer requests from the same array in the same call. This may be set for MultiArrayUDFs that use the `argument_json` style of passing arrays. ") - public String getParameterId() { return parameterId; } - public void setParameterId(String parameterId) { this.parameterId = parameterId; } public UDFArrayDetails uri(String uri) { - this.uri = uri; return this; } - /** + /** * array to set ranges and buffers on, must be in tiledb:// format * @return uri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "array to set ranges and buffers on, must be in tiledb:// format") - public String getUri() { return uri; } - public void setUri(String uri) { this.uri = uri; } public UDFArrayDetails ranges(QueryRanges ranges) { - this.ranges = ranges; return this; } - /** + /** * Get ranges * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public QueryRanges getRanges() { return ranges; } - public void setRanges(QueryRanges ranges) { this.ranges = ranges; } public UDFArrayDetails buffers(List buffers) { - this.buffers = buffers; return this; } @@ -149,57 +144,19 @@ public UDFArrayDetails addBuffersItem(String buffersItem) { return this; } - /** + /** * List of buffers to fetch (attributes + dimensions) * @return buffers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of buffers to fetch (attributes + dimensions)") - public List getBuffers() { return buffers; } - public void setBuffers(List buffers) { this.buffers = buffers; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFArrayDetails putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -214,8 +171,7 @@ public boolean equals(Object o) { return Objects.equals(this.parameterId, udFArrayDetails.parameterId) && Objects.equals(this.uri, udFArrayDetails.uri) && Objects.equals(this.ranges, udFArrayDetails.ranges) && - Objects.equals(this.buffers, udFArrayDetails.buffers)&& - Objects.equals(this.additionalProperties, udFArrayDetails.additionalProperties); + Objects.equals(this.buffers, udFArrayDetails.buffers); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -224,7 +180,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(parameterId, uri, ranges, buffers, additionalProperties); + return Objects.hash(parameterId, uri, ranges, buffers); } private static int hashCodeNullable(JsonNullable a) { @@ -242,7 +198,6 @@ public String toString() { sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); sb.append(" buffers: ").append(toIndentedString(buffers)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -274,32 +229,39 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFArrayDetails - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFArrayDetails.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFArrayDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFArrayDetails.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFArrayDetails is not found in the empty JSON string", UDFArrayDetails.openapiRequiredFields.toString())); } } - if (jsonObj.get("parameter_id") != null && !jsonObj.get("parameter_id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFArrayDetails.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFArrayDetails` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("parameter_id") != null && !jsonObj.get("parameter_id").isJsonNull()) && !jsonObj.get("parameter_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `parameter_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parameter_id").toString())); } - if (jsonObj.get("uri") != null && !jsonObj.get("uri").isJsonPrimitive()) { + 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())); } // validate the optional field `ranges` - if (jsonObj.getAsJsonObject("ranges") != null) { - QueryRanges.validateJsonObject(jsonObj.getAsJsonObject("ranges")); + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull()) { + QueryRanges.validateJsonElement(jsonObj.get("ranges")); } - // ensure the json data is an array - if (jsonObj.get("buffers") != null && !jsonObj.get("buffers").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("buffers") != null && !jsonObj.get("buffers").isJsonNull() && !jsonObj.get("buffers").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `buffers` to be an array in the JSON string but got `%s`", jsonObj.get("buffers").toString())); } } @@ -319,71 +281,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFArrayDetails value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFArrayDetails read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFArrayDetails instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFArrayDetails given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFArrayDetails - * @throws IOException if the JSON string is invalid with respect to UDFArrayDetails - */ + /** + * Create an instance of UDFArrayDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFArrayDetails + * @throws IOException if the JSON string is invalid with respect to UDFArrayDetails + */ public static UDFArrayDetails fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFArrayDetails.class); } - /** - * Convert an instance of UDFArrayDetails to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFArrayDetails 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/model/UDFCopied.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFCopied.java index bbf7fac..f114d8a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFCopied.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFCopied.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * Copied udf uri and information */ -@ApiModel(description = "Copied udf uri and information") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFCopied { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) @@ -60,135 +67,84 @@ public class UDFCopied { @SerializedName(SERIALIZED_NAME_ID) private String id; - public UDFCopied() { + public UDFCopied() { } public UDFCopied outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB udf * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB udf") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public UDFCopied namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace of the copied udf * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "namespace of the copied udf") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public UDFCopied name(String name) { - this.name = name; return this; } - /** + /** * name of the copied udf * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of the copied udf") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public UDFCopied id(String id) { - this.id = id; return this; } - /** + /** * unique ID of the copied udf * @return id - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "unique ID of the copied udf") - public String getId() { return id; } - public void setId(String id) { this.id = id; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFCopied putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -203,13 +159,12 @@ public boolean equals(Object o) { return Objects.equals(this.outputUri, udFCopied.outputUri) && Objects.equals(this.namespace, udFCopied.namespace) && Objects.equals(this.name, udFCopied.name) && - Objects.equals(this.id, udFCopied.id)&& - Objects.equals(this.additionalProperties, udFCopied.additionalProperties); + Objects.equals(this.id, udFCopied.id); } @Override public int hashCode() { - return Objects.hash(outputUri, namespace, name, id, additionalProperties); + return Objects.hash(outputUri, namespace, name, id); } @Override @@ -220,7 +175,6 @@ public String toString() { sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -253,37 +207,44 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFCopied - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFCopied.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFCopied + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFCopied.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFCopied is not found in the empty JSON string", UDFCopied.openapiRequiredFields.toString())); } } + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFCopied.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFCopied` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string for (String requiredField : UDFCopied.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + 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())); } } @@ -303,71 +264,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFCopied value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFCopied read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFCopied instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFCopied given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFCopied - * @throws IOException if the JSON string is invalid with respect to UDFCopied - */ + /** + * Create an instance of UDFCopied given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFCopied + * @throws IOException if the JSON string is invalid with respect to UDFCopied + */ public static UDFCopied fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFCopied.class); } - /** - * Convert an instance of UDFCopied to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFCopied 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/model/UDFCopy.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFCopy.java index 923ce3d..706af77 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFCopy.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFCopy.java @@ -14,26 +14,34 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +49,7 @@ /** * information required to copy a udf */ -@ApiModel(description = "information required to copy a udf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFCopy { public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; @SerializedName(SERIALIZED_NAME_OUTPUT_URI) @@ -56,112 +63,65 @@ public class UDFCopy { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public UDFCopy() { + public UDFCopy() { } public UDFCopy outputUri(String outputUri) { - this.outputUri = outputUri; return this; } - /** + /** * output location of the TileDB File * @return outputUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "output location of the TileDB File") - public String getOutputUri() { return outputUri; } - public void setOutputUri(String outputUri) { this.outputUri = outputUri; } public UDFCopy namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace to register the copy. If empty use the namespace of the request user * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "namespace to register the copy. If empty use the namespace of the request user") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public UDFCopy name(String name) { - this.name = name; return this; } - /** + /** * name to set for the copy. If empty use the name as the original udf, if it not already used in the namespace * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name to set for the copy. If empty use the name as the original udf, if it not already used in the namespace") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFCopy putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +135,12 @@ public boolean equals(Object o) { UDFCopy udFCopy = (UDFCopy) o; return Objects.equals(this.outputUri, udFCopy.outputUri) && Objects.equals(this.namespace, udFCopy.namespace) && - Objects.equals(this.name, udFCopy.name)&& - Objects.equals(this.additionalProperties, udFCopy.additionalProperties); + Objects.equals(this.name, udFCopy.name); } @Override public int hashCode() { - return Objects.hash(outputUri, namespace, name, additionalProperties); + return Objects.hash(outputUri, namespace, name); } @Override @@ -191,7 +150,6 @@ public String toString() { sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFCopy - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFCopy.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFCopy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFCopy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFCopy is not found in the empty JSON string", UDFCopy.openapiRequiredFields.toString())); } } - if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFCopy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFCopy` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonNull()) && !jsonObj.get("output_uri").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -262,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFCopy value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFCopy read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFCopy instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFCopy given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFCopy - * @throws IOException if the JSON string is invalid with respect to UDFCopy - */ + /** + * Create an instance of UDFCopy given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFCopy + * @throws IOException if the JSON string is invalid with respect to UDFCopy + */ public static UDFCopy fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFCopy.class); } - /** - * Convert an instance of UDFCopy to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFCopy 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/model/UDFFavorite.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFFavorite.java index 5385673..ed7f9b3 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFFavorite.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFFavorite.java @@ -14,34 +14,42 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * A user-favorite UDF item */ -@ApiModel(description = "A user-favorite UDF item") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFFavorite { public static final String SERIALIZED_NAME_UDF_UUID = "udf_uuid"; @SerializedName(SERIALIZED_NAME_UDF_UUID) @@ -55,112 +63,65 @@ public class UDFFavorite { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public UDFFavorite() { + public UDFFavorite() { } public UDFFavorite udfUuid(String udfUuid) { - this.udfUuid = udfUuid; return this; } - /** + /** * unique UUID of the UDF * @return udfUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "unique UUID of the UDF") - public String getUdfUuid() { return udfUuid; } - public void setUdfUuid(String udfUuid) { this.udfUuid = udfUuid; } public UDFFavorite namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * the namespace of the UDF * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the namespace of the UDF") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public UDFFavorite name(String name) { - this.name = name; return this; } - /** + /** * the name of the UDF * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the name of the UDF") - public String getName() { return name; } - public void setName(String name) { this.name = name; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFFavorite putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -174,13 +135,12 @@ public boolean equals(Object o) { UDFFavorite udFFavorite = (UDFFavorite) o; return Objects.equals(this.udfUuid, udFFavorite.udfUuid) && Objects.equals(this.namespace, udFFavorite.namespace) && - Objects.equals(this.name, udFFavorite.name)&& - Objects.equals(this.additionalProperties, udFFavorite.additionalProperties); + Objects.equals(this.name, udFFavorite.name); } @Override public int hashCode() { - return Objects.hash(udfUuid, namespace, name, additionalProperties); + return Objects.hash(udfUuid, namespace, name); } @Override @@ -190,7 +150,6 @@ public String toString() { sb.append(" udfUuid: ").append(toIndentedString(udfUuid)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -221,27 +180,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFFavorite - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFFavorite.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFFavorite + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFFavorite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFFavorite is not found in the empty JSON string", UDFFavorite.openapiRequiredFields.toString())); } } - if (jsonObj.get("udf_uuid") != null && !jsonObj.get("udf_uuid").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFFavorite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFFavorite` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("udf_uuid") != null && !jsonObj.get("udf_uuid").isJsonNull()) && !jsonObj.get("udf_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `udf_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("udf_uuid").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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())); } } @@ -261,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFFavorite value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFFavorite read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFFavorite instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFFavorite given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFFavorite - * @throws IOException if the JSON string is invalid with respect to UDFFavorite - */ + /** + * Create an instance of UDFFavorite given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFFavorite + * @throws IOException if the JSON string is invalid with respect to UDFFavorite + */ public static UDFFavorite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFFavorite.class); } - /** - * Convert an instance of UDFFavorite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFFavorite 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/model/UDFFavoritesData.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFFavoritesData.java index bd20fd9..6b6ffe8 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFFavoritesData.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFFavoritesData.java @@ -14,51 +14,59 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.tiledb.cloud.rest_api.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; +import io.tiledb.cloud.rest_api.JSON; + /** * Object including UDF favorites and pagination metadata */ -@ApiModel(description = "Object including UDF favorites and pagination metadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFFavoritesData { public static final String SERIALIZED_NAME_UDFS = "udfs"; @SerializedName(SERIALIZED_NAME_UDFS) - private List udfs = null; + private List udfs = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) private PaginationMetadata paginationMetadata; - public UDFFavoritesData() { + public UDFFavoritesData() { } public UDFFavoritesData udfs(List udfs) { - this.udfs = udfs; return this; } @@ -71,80 +79,38 @@ public UDFFavoritesData addUdfsItem(ArrayInfo udfsItem) { return this; } - /** + /** * List of UDF infos * @return udfs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of UDF infos") - public List getUdfs() { return udfs; } - public void setUdfs(List udfs) { this.udfs = udfs; } public UDFFavoritesData paginationMetadata(PaginationMetadata paginationMetadata) { - this.paginationMetadata = paginationMetadata; return this; } - /** + /** * Get paginationMetadata * @return paginationMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public PaginationMetadata getPaginationMetadata() { return paginationMetadata; } - public void setPaginationMetadata(PaginationMetadata paginationMetadata) { this.paginationMetadata = paginationMetadata; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFFavoritesData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -157,13 +123,12 @@ public boolean equals(Object o) { } UDFFavoritesData udFFavoritesData = (UDFFavoritesData) o; return Objects.equals(this.udfs, udFFavoritesData.udfs) && - Objects.equals(this.paginationMetadata, udFFavoritesData.paginationMetadata)&& - Objects.equals(this.additionalProperties, udFFavoritesData.additionalProperties); + Objects.equals(this.paginationMetadata, udFFavoritesData.paginationMetadata); } @Override public int hashCode() { - return Objects.hash(udfs, paginationMetadata, additionalProperties); + return Objects.hash(udfs, paginationMetadata); } @Override @@ -172,7 +137,6 @@ public String toString() { sb.append("class UDFFavoritesData {\n"); sb.append(" udfs: ").append(toIndentedString(udfs)).append("\n"); sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -202,35 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFFavoritesData - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFFavoritesData.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFFavoritesData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFFavoritesData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFFavoritesData is not found in the empty JSON string", UDFFavoritesData.openapiRequiredFields.toString())); } } - JsonArray jsonArrayudfs = jsonObj.getAsJsonArray("udfs"); - if (jsonArrayudfs != null) { - // ensure the json data is an array - if (!jsonObj.get("udfs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `udfs` to be an array in the JSON string but got `%s`", jsonObj.get("udfs").toString())); - } - // validate the optional field `udfs` (array) - for (int i = 0; i < jsonArrayudfs.size(); i++) { - ArrayInfo.validateJsonObject(jsonArrayudfs.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFFavoritesData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFFavoritesData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("udfs") != null && !jsonObj.get("udfs").isJsonNull()) { + JsonArray jsonArrayudfs = jsonObj.getAsJsonArray("udfs"); + if (jsonArrayudfs != null) { + // ensure the json data is an array + if (!jsonObj.get("udfs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `udfs` to be an array in the JSON string but got `%s`", jsonObj.get("udfs").toString())); + } + + // validate the optional field `udfs` (array) + for (int i = 0; i < jsonArrayudfs.size(); i++) { + ArrayInfo.validateJsonElement(jsonArrayudfs.get(i)); + }; + } } // validate the optional field `pagination_metadata` - if (jsonObj.getAsJsonObject("pagination_metadata") != null) { - PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + if (jsonObj.get("pagination_metadata") != null && !jsonObj.get("pagination_metadata").isJsonNull()) { + PaginationMetadata.validateJsonElement(jsonObj.get("pagination_metadata")); } } @@ -249,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFFavoritesData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFFavoritesData read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFFavoritesData instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFFavoritesData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFFavoritesData - * @throws IOException if the JSON string is invalid with respect to UDFFavoritesData - */ + /** + * Create an instance of UDFFavoritesData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFFavoritesData + * @throws IOException if the JSON string is invalid with respect to UDFFavoritesData + */ public static UDFFavoritesData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFFavoritesData.class); } - /** - * Convert an instance of UDFFavoritesData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFFavoritesData 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/model/UDFImage.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFImage.java index b1f815b..a90900d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFImage.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFImage.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.UDFLanguage; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * Defines a set of images related to a specific name */ -@ApiModel(description = "Defines a set of images related to a specific name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFImage { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -56,112 +64,65 @@ public class UDFImage { @SerializedName(SERIALIZED_NAME_LANGUAGE) private UDFLanguage language; - public UDFImage() { + public UDFImage() { } public UDFImage id(String id) { - this.id = id; return this; } - /** + /** * Unique ID of set of images * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of set of images") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public UDFImage name(String name) { - this.name = name; return this; } - /** + /** * name of UDF * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of UDF") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public UDFImage language(UDFLanguage language) { - this.language = language; return this; } - /** + /** * Get language * @return language - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFLanguage getLanguage() { return language; } - public void setLanguage(UDFLanguage language) { this.language = language; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFImage putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +136,12 @@ public boolean equals(Object o) { UDFImage udFImage = (UDFImage) o; return Objects.equals(this.id, udFImage.id) && Objects.equals(this.name, udFImage.name) && - Objects.equals(this.language, udFImage.language)&& - Objects.equals(this.additionalProperties, udFImage.additionalProperties); + Objects.equals(this.language, udFImage.language); } @Override public int hashCode() { - return Objects.hash(id, name, language, additionalProperties); + return Objects.hash(id, name, language); } @Override @@ -191,7 +151,6 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" language: ").append(toIndentedString(language)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,26 +181,37 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFImage - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFImage.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFImage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFImage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFImage is not found in the empty JSON string", UDFImage.openapiRequiredFields.toString())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFImage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFImage` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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 `language` + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) { + UDFLanguage.validateJsonElement(jsonObj.get("language")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -259,71 +229,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFImage value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFImage read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFImage instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFImage given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFImage - * @throws IOException if the JSON string is invalid with respect to UDFImage - */ + /** + * Create an instance of UDFImage given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFImage + * @throws IOException if the JSON string is invalid with respect to UDFImage + */ public static UDFImage fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFImage.class); } - /** - * Convert an instance of UDFImage to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFImage 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/model/UDFImageVersion.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFImageVersion.java index a2f8439..4b8e5f0 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFImageVersion.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFImageVersion.java @@ -14,27 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -42,8 +50,7 @@ /** * Defines an image that belongs to a set of images having a version */ -@ApiModel(description = "Defines an image that belongs to a set of images having a version") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFImageVersion { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -73,204 +80,141 @@ public class UDFImageVersion { @SerializedName(SERIALIZED_NAME_LATEST) private Boolean latest; - public UDFImageVersion() { + public UDFImageVersion() { } public UDFImageVersion id(String id) { - this.id = id; return this; } - /** + /** * Unique ID of a versioned image * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of a versioned image") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public UDFImageVersion name(String name) { - this.name = name; return this; } - /** + /** * name of UDFImageVersion * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of UDFImageVersion") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public UDFImageVersion udfImageUuid(String udfImageUuid) { - this.udfImageUuid = udfImageUuid; return this; } - /** + /** * Unique ID of the UDF image set * @return udfImageUuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of the UDF image set") - public String getUdfImageUuid() { return udfImageUuid; } - public void setUdfImageUuid(String udfImageUuid) { this.udfImageUuid = udfImageUuid; } public UDFImageVersion dockerImage(String dockerImage) { - this.dockerImage = dockerImage; return this; } - /** + /** * Uri of docker image related to current entry * @return dockerImage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Uri of docker image related to current entry") - public String getDockerImage() { return dockerImage; } - public void setDockerImage(String dockerImage) { this.dockerImage = dockerImage; } public UDFImageVersion version(BigDecimal version) { - this.version = version; return this; } - /** + /** * Image-specific version * @return version - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "2.0", value = "Image-specific version") - public BigDecimal getVersion() { return version; } - public void setVersion(BigDecimal version) { this.version = version; } public UDFImageVersion _default(Boolean _default) { - this._default = _default; return this; } - /** + /** * If current image is default version * @return _default - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "If current image is default version") - public Boolean getDefault() { return _default; } - public void setDefault(Boolean _default) { this._default = _default; } public UDFImageVersion latest(Boolean latest) { - this.latest = latest; return this; } - /** + /** * If current image is latest version * @return latest - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "If current image is latest version") - public Boolean getLatest() { return latest; } - public void setLatest(Boolean latest) { this.latest = latest; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFImageVersion putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -288,13 +232,12 @@ public boolean equals(Object o) { Objects.equals(this.dockerImage, udFImageVersion.dockerImage) && Objects.equals(this.version, udFImageVersion.version) && Objects.equals(this._default, udFImageVersion._default) && - Objects.equals(this.latest, udFImageVersion.latest)&& - Objects.equals(this.additionalProperties, udFImageVersion.additionalProperties); + Objects.equals(this.latest, udFImageVersion.latest); } @Override public int hashCode() { - return Objects.hash(id, name, udfImageUuid, dockerImage, version, _default, latest, additionalProperties); + return Objects.hash(id, name, udfImageUuid, dockerImage, version, _default, latest); } @Override @@ -308,7 +251,6 @@ public String toString() { sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); sb.append(" latest: ").append(toIndentedString(latest)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -343,30 +285,37 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFImageVersion - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFImageVersion.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFImageVersion + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFImageVersion.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFImageVersion is not found in the empty JSON string", UDFImageVersion.openapiRequiredFields.toString())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFImageVersion.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFImageVersion` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("udf_image_uuid") != null && !jsonObj.get("udf_image_uuid").isJsonPrimitive()) { + if ((jsonObj.get("udf_image_uuid") != null && !jsonObj.get("udf_image_uuid").isJsonNull()) && !jsonObj.get("udf_image_uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `udf_image_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("udf_image_uuid").toString())); } - if (jsonObj.get("docker_image") != null && !jsonObj.get("docker_image").isJsonPrimitive()) { + if ((jsonObj.get("docker_image") != null && !jsonObj.get("docker_image").isJsonNull()) && !jsonObj.get("docker_image").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `docker_image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("docker_image").toString())); } } @@ -386,71 +335,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFImageVersion value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFImageVersion read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFImageVersion instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFImageVersion given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFImageVersion - * @throws IOException if the JSON string is invalid with respect to UDFImageVersion - */ + /** + * Create an instance of UDFImageVersion given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFImageVersion + * @throws IOException if the JSON string is invalid with respect to UDFImageVersion + */ public static UDFImageVersion fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFImageVersion.class); } - /** - * Convert an instance of UDFImageVersion to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFImageVersion 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/model/UDFInfo.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFInfo.java index acf9790..d53725a 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFInfo.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFInfo.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.UDFLanguage; +import io.tiledb.cloud.rest_api.model.UDFType; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +53,7 @@ /** * User-defined function that can persist in db, used and shared multiple times */ -@ApiModel(description = "User-defined function that can persist in db, used and shared multiple times") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFInfo { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -76,174 +85,145 @@ public class UDFInfo { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); - public UDFInfo() { + public UDFInfo() { } public UDFInfo id(String id) { - this.id = id; return this; } - /** + /** * Unique ID of UDF * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "Unique ID of UDF") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public UDFInfo name(String name) { - this.name = name; return this; } - /** + /** * name of UDF * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of UDF") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public UDFInfo language(UDFLanguage language) { - this.language = language; return this; } - /** + /** * Get language * @return language - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFLanguage getLanguage() { return language; } - public void setLanguage(UDFLanguage language) { this.language = language; } public UDFInfo type(UDFType type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFType getType() { return type; } - public void setType(UDFType type) { this.type = type; } public UDFInfo readme(String readme) { - this.readme = readme; return this; } - /** + /** * Markdown readme of UDFs * @return readme - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Markdown readme of UDFs") - public String getReadme() { return readme; } - public void setReadme(String readme) { this.readme = readme; } public UDFInfo licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public UDFInfo licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } public UDFInfo tags(List tags) { - this.tags = tags; return this; } @@ -256,57 +236,19 @@ public UDFInfo addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for UDF * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for UDF") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFInfo putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -325,13 +267,12 @@ public boolean equals(Object o) { Objects.equals(this.readme, udFInfo.readme) && Objects.equals(this.licenseId, udFInfo.licenseId) && Objects.equals(this.licenseText, udFInfo.licenseText) && - Objects.equals(this.tags, udFInfo.tags)&& - Objects.equals(this.additionalProperties, udFInfo.additionalProperties); + Objects.equals(this.tags, udFInfo.tags); } @Override public int hashCode() { - return Objects.hash(id, name, language, type, readme, licenseId, licenseText, tags, additionalProperties); + return Objects.hash(id, name, language, type, readme, licenseId, licenseText, tags); } @Override @@ -346,7 +287,6 @@ public String toString() { sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -382,37 +322,52 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFInfo is not found in the empty JSON string", UDFInfo.openapiRequiredFields.toString())); } } - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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())); } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + 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("readme") != null && !jsonObj.get("readme").isJsonPrimitive()) { + // validate the optional field `language` + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) { + UDFLanguage.validateJsonElement(jsonObj.get("language")); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + UDFType.validateJsonElement(jsonObj.get("type")); + } + if ((jsonObj.get("readme") != null && !jsonObj.get("readme").isJsonNull()) && !jsonObj.get("readme").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `readme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("readme").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } } @@ -432,71 +387,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFInfo instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFInfo - * @throws IOException if the JSON string is invalid with respect to UDFInfo - */ + /** + * Create an instance of UDFInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFInfo + * @throws IOException if the JSON string is invalid with respect to UDFInfo + */ public static UDFInfo fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFInfo.class); } - /** - * Convert an instance of UDFInfo to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFInfo 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/model/UDFInfoUpdate.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdate.java index ad37760..7ee6587 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdate.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdate.java @@ -14,28 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.UDFLanguage; +import io.tiledb.cloud.rest_api.model.UDFType; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,8 +53,7 @@ /** * User-defined function that can persist in db, used and shared multiple times */ -@ApiModel(description = "User-defined function that can persist in db, used and shared multiple times") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFInfoUpdate { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -88,243 +97,202 @@ public class UDFInfoUpdate { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = null; + private List tags = new ArrayList<>(); - public UDFInfoUpdate() { + public UDFInfoUpdate() { } public UDFInfoUpdate name(String name) { - this.name = name; return this; } - /** + /** * name of UDF * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "name of UDF") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public UDFInfoUpdate language(UDFLanguage language) { - this.language = language; return this; } - /** + /** * Get language * @return language - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFLanguage getLanguage() { return language; } - public void setLanguage(UDFLanguage language) { this.language = language; } public UDFInfoUpdate version(String version) { - this.version = version; return this; } - /** + /** * Type-specific version * @return version - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Type-specific version") - public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } public UDFInfoUpdate imageName(String imageName) { - this.imageName = imageName; return this; } - /** + /** * Docker image name to use for UDF * @return imageName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Docker image name to use for UDF") - public String getImageName() { return imageName; } - public void setImageName(String imageName) { this.imageName = imageName; } public UDFInfoUpdate type(UDFType type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UDFType getType() { return type; } - public void setType(UDFType type) { this.type = type; } public UDFInfoUpdate exec(String exec) { - this.exec = exec; return this; } - /** + /** * Type-specific executable text * @return exec - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Type-specific executable text") - public String getExec() { return exec; } - public void setExec(String exec) { this.exec = exec; } public UDFInfoUpdate execRaw(String execRaw) { - this.execRaw = execRaw; return this; } - /** + /** * optional raw text to store of serialized function, used for showing in UI * @return execRaw - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional raw text to store of serialized function, used for showing in UI") - public String getExecRaw() { return execRaw; } - public void setExecRaw(String execRaw) { this.execRaw = execRaw; } public UDFInfoUpdate readme(String readme) { - this.readme = readme; return this; } - /** + /** * Markdown readme of UDFs * @return readme - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Markdown readme of UDFs") - public String getReadme() { return readme; } - public void setReadme(String readme) { this.readme = readme; } public UDFInfoUpdate licenseId(String licenseId) { - this.licenseId = licenseId; return this; } - /** + /** * License identifier from SPDX License List or Custom * @return licenseId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License identifier from SPDX License List or Custom") - public String getLicenseId() { return licenseId; } - public void setLicenseId(String licenseId) { this.licenseId = licenseId; } public UDFInfoUpdate licenseText(String licenseText) { - this.licenseText = licenseText; return this; } - /** + /** * License text * @return licenseText - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "License text") - public String getLicenseText() { return licenseText; } - public void setLicenseText(String licenseText) { this.licenseText = licenseText; } public UDFInfoUpdate tags(List tags) { - this.tags = tags; return this; } @@ -337,57 +305,19 @@ public UDFInfoUpdate addTagsItem(String tagsItem) { return this; } - /** + /** * optional tags for UDF * @return tags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "optional tags for UDF") - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFInfoUpdate putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -409,13 +339,12 @@ public boolean equals(Object o) { Objects.equals(this.readme, udFInfoUpdate.readme) && Objects.equals(this.licenseId, udFInfoUpdate.licenseId) && Objects.equals(this.licenseText, udFInfoUpdate.licenseText) && - Objects.equals(this.tags, udFInfoUpdate.tags)&& - Objects.equals(this.additionalProperties, udFInfoUpdate.additionalProperties); + Objects.equals(this.tags, udFInfoUpdate.tags); } @Override public int hashCode() { - return Objects.hash(name, language, version, imageName, type, exec, execRaw, readme, licenseId, licenseText, tags, additionalProperties); + return Objects.hash(name, language, version, imageName, type, exec, execRaw, readme, licenseId, licenseText, tags); } @Override @@ -433,7 +362,6 @@ public String toString() { sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -472,46 +400,61 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFInfoUpdate - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFInfoUpdate.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFInfoUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFInfoUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFInfoUpdate is not found in the empty JSON string", UDFInfoUpdate.openapiRequiredFields.toString())); } } - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFInfoUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFInfoUpdate` 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("version") != null && !jsonObj.get("version").isJsonPrimitive()) { + // validate the optional field `language` + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonNull()) { + UDFLanguage.validateJsonElement(jsonObj.get("language")); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } - if (jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonPrimitive()) { + if ((jsonObj.get("image_name") != null && !jsonObj.get("image_name").isJsonNull()) && !jsonObj.get("image_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `image_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image_name").toString())); } - if (jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonPrimitive()) { + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + UDFType.validateJsonElement(jsonObj.get("type")); + } + if ((jsonObj.get("exec") != null && !jsonObj.get("exec").isJsonNull()) && !jsonObj.get("exec").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exec").toString())); } - if (jsonObj.get("exec_raw") != null && !jsonObj.get("exec_raw").isJsonPrimitive()) { + if ((jsonObj.get("exec_raw") != null && !jsonObj.get("exec_raw").isJsonNull()) && !jsonObj.get("exec_raw").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exec_raw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exec_raw").toString())); } - if (jsonObj.get("readme") != null && !jsonObj.get("readme").isJsonPrimitive()) { + if ((jsonObj.get("readme") != null && !jsonObj.get("readme").isJsonNull()) && !jsonObj.get("readme").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `readme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("readme").toString())); } - if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + if ((jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonNull()) && !jsonObj.get("license_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); } - if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + if ((jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonNull()) && !jsonObj.get("license_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); } - // ensure the json data is an array - if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull() && !jsonObj.get("tags").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); } } @@ -531,71 +474,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFInfoUpdate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFInfoUpdate read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFInfoUpdate instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFInfoUpdate given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFInfoUpdate - * @throws IOException if the JSON string is invalid with respect to UDFInfoUpdate - */ + /** + * Create an instance of UDFInfoUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFInfoUpdate + * @throws IOException if the JSON string is invalid with respect to UDFInfoUpdate + */ public static UDFInfoUpdate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFInfoUpdate.class); } - /** - * Convert an instance of UDFInfoUpdate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFInfoUpdate 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/model/UDFLanguage.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFLanguage.java index a97d4be..0d790fa 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFLanguage.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFLanguage.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public UDFLanguage read(final JsonReader jsonReader) throws IOException { return UDFLanguage.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UDFLanguage.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/UDFSharing.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFSharing.java index ee45d7b..625c710 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFSharing.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFSharing.java @@ -14,28 +14,37 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.UDFActions; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -43,12 +52,11 @@ /** * details for sharing a given UDF */ -@ApiModel(description = "details for sharing a given UDF") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFSharing { public static final String SERIALIZED_NAME_ACTIONS = "actions"; @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = null; + private List actions = new ArrayList<>(); public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) @@ -58,11 +66,10 @@ public class UDFSharing { @SerializedName(SERIALIZED_NAME_NAMESPACE_TYPE) private String namespaceType; - public UDFSharing() { + public UDFSharing() { } public UDFSharing actions(List actions) { - this.actions = actions; return this; } @@ -75,103 +82,57 @@ public UDFSharing addActionsItem(UDFActions actionsItem) { return this; } - /** + /** * List of permitted actions * @return actions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "[fetch, share]", value = "List of permitted actions") - public List getActions() { return actions; } - public void setActions(List actions) { this.actions = actions; } public UDFSharing namespace(String namespace) { - this.namespace = namespace; return this; } - /** + /** * namespace being granted array access can be a user or organization * @return namespace - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "MyOrganization", value = "namespace being granted array access can be a user or organization") - public String getNamespace() { return namespace; } - public void setNamespace(String namespace) { this.namespace = namespace; } public UDFSharing namespaceType(String namespaceType) { - this.namespaceType = namespaceType; return this; } - /** + /** * details on if the namespace is a organization or user * @return namespaceType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "organization", value = "details on if the namespace is a organization or user") - public String getNamespaceType() { return namespaceType; } - public void setNamespaceType(String namespaceType) { this.namespaceType = namespaceType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFSharing putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -185,13 +146,12 @@ public boolean equals(Object o) { UDFSharing udFSharing = (UDFSharing) o; return Objects.equals(this.actions, udFSharing.actions) && Objects.equals(this.namespace, udFSharing.namespace) && - Objects.equals(this.namespaceType, udFSharing.namespaceType)&& - Objects.equals(this.additionalProperties, udFSharing.additionalProperties); + Objects.equals(this.namespaceType, udFSharing.namespaceType); } @Override public int hashCode() { - return Objects.hash(actions, namespace, namespaceType, additionalProperties); + return Objects.hash(actions, namespace, namespaceType); } @Override @@ -201,7 +161,6 @@ public String toString() { sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" namespaceType: ").append(toIndentedString(namespaceType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -232,28 +191,35 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFSharing - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFSharing.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFSharing + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFSharing.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFSharing is not found in the empty JSON string", UDFSharing.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonArray()) { + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFSharing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFSharing` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("actions") != null && !jsonObj.get("actions").isJsonNull() && !jsonObj.get("actions").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); } - if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } - if (jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonPrimitive()) { + if ((jsonObj.get("namespace_type") != null && !jsonObj.get("namespace_type").isJsonNull()) && !jsonObj.get("namespace_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_type").toString())); } } @@ -273,71 +239,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFSharing value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFSharing read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFSharing instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFSharing given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFSharing - * @throws IOException if the JSON string is invalid with respect to UDFSharing - */ + /** + * Create an instance of UDFSharing given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFSharing + * @throws IOException if the JSON string is invalid with respect to UDFSharing + */ public static UDFSharing fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFSharing.class); } - /** - * Convert an instance of UDFSharing to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFSharing 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/model/UDFSubarray.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarray.java index 68c30b5..a2e9c8d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarray.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarray.java @@ -14,29 +14,38 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.Layout; +import io.tiledb.cloud.rest_api.model.UDFSubarrayRange; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -44,8 +53,7 @@ /** * Subarray bounds to query for a UDF to operate on */ -@ApiModel(description = "Subarray bounds to query for a UDF to operate on") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFSubarray { public static final String SERIALIZED_NAME_LAYOUT = "layout"; @SerializedName(SERIALIZED_NAME_LAYOUT) @@ -53,36 +61,31 @@ public class UDFSubarray { public static final String SERIALIZED_NAME_RANGES = "ranges"; @SerializedName(SERIALIZED_NAME_RANGES) - private List ranges = null; + private List ranges = new ArrayList<>(); - public UDFSubarray() { + public UDFSubarray() { } public UDFSubarray layout(Layout layout) { - this.layout = layout; return this; } - /** + /** * Get layout * @return layout - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Layout getLayout() { return layout; } - public void setLayout(Layout layout) { this.layout = layout; } public UDFSubarray ranges(List ranges) { - this.ranges = ranges; return this; } @@ -95,57 +98,19 @@ public UDFSubarray addRangesItem(UDFSubarrayRange rangesItem) { return this; } - /** + /** * List of ranges, * @return ranges - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of ranges,") - public List getRanges() { return ranges; } - public void setRanges(List ranges) { this.ranges = ranges; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFSubarray putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -158,13 +123,12 @@ public boolean equals(Object o) { } UDFSubarray udFSubarray = (UDFSubarray) o; return Objects.equals(this.layout, udFSubarray.layout) && - Objects.equals(this.ranges, udFSubarray.ranges)&& - Objects.equals(this.additionalProperties, udFSubarray.additionalProperties); + Objects.equals(this.ranges, udFSubarray.ranges); } @Override public int hashCode() { - return Objects.hash(layout, ranges, additionalProperties); + return Objects.hash(layout, ranges); } @Override @@ -173,7 +137,6 @@ public String toString() { sb.append("class UDFSubarray {\n"); sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -203,31 +166,44 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFSubarray - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFSubarray.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFSubarray + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFSubarray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFSubarray is not found in the empty JSON string", UDFSubarray.openapiRequiredFields.toString())); } } - JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); - if (jsonArrayranges != null) { - // ensure the json data is an array - if (!jsonObj.get("ranges").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); - } - // validate the optional field `ranges` (array) - for (int i = 0; i < jsonArrayranges.size(); i++) { - UDFSubarrayRange.validateJsonObject(jsonArrayranges.get(i).getAsJsonObject()); - }; + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFSubarray.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFSubarray` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `layout` + if (jsonObj.get("layout") != null && !jsonObj.get("layout").isJsonNull()) { + Layout.validateJsonElement(jsonObj.get("layout")); + } + if (jsonObj.get("ranges") != null && !jsonObj.get("ranges").isJsonNull()) { + JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); + if (jsonArrayranges != null) { + // ensure the json data is an array + if (!jsonObj.get("ranges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); + } + + // validate the optional field `ranges` (array) + for (int i = 0; i < jsonArrayranges.size(); i++) { + UDFSubarrayRange.validateJsonElement(jsonArrayranges.get(i)); + }; + } } } @@ -246,71 +222,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFSubarray value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFSubarray read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFSubarray instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFSubarray given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFSubarray - * @throws IOException if the JSON string is invalid with respect to UDFSubarray - */ + /** + * Create an instance of UDFSubarray given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFSubarray + * @throws IOException if the JSON string is invalid with respect to UDFSubarray + */ public static UDFSubarray fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFSubarray.class); } - /** - * Convert an instance of UDFSubarray to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFSubarray 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/model/UDFSubarrayRange.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRange.java index 021faaf..be1ad4d 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRange.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRange.java @@ -14,26 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.DimensionCoordinate; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -41,8 +50,7 @@ /** * A dimension range to query */ -@ApiModel(description = "A dimension range to query") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class UDFSubarrayRange { public static final String SERIALIZED_NAME_DIMENSION_ID = "dimension_id"; @SerializedName(SERIALIZED_NAME_DIMENSION_ID) @@ -56,112 +64,65 @@ public class UDFSubarrayRange { @SerializedName(SERIALIZED_NAME_RANGE_END) private DimensionCoordinate rangeEnd; - public UDFSubarrayRange() { + public UDFSubarrayRange() { } public UDFSubarrayRange dimensionId(Integer dimensionId) { - this.dimensionId = dimensionId; return this; } - /** + /** * The dimension index * @return dimensionId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The dimension index") - public Integer getDimensionId() { return dimensionId; } - public void setDimensionId(Integer dimensionId) { this.dimensionId = dimensionId; } public UDFSubarrayRange rangeStart(DimensionCoordinate rangeStart) { - this.rangeStart = rangeStart; return this; } - /** + /** * Get rangeStart * @return rangeStart - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DimensionCoordinate getRangeStart() { return rangeStart; } - public void setRangeStart(DimensionCoordinate rangeStart) { this.rangeStart = rangeStart; } public UDFSubarrayRange rangeEnd(DimensionCoordinate rangeEnd) { - this.rangeEnd = rangeEnd; return this; } - /** + /** * Get rangeEnd * @return rangeEnd - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DimensionCoordinate getRangeEnd() { return rangeEnd; } - public void setRangeEnd(DimensionCoordinate rangeEnd) { this.rangeEnd = rangeEnd; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public UDFSubarrayRange putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -175,13 +136,12 @@ public boolean equals(Object o) { UDFSubarrayRange udFSubarrayRange = (UDFSubarrayRange) o; return Objects.equals(this.dimensionId, udFSubarrayRange.dimensionId) && Objects.equals(this.rangeStart, udFSubarrayRange.rangeStart) && - Objects.equals(this.rangeEnd, udFSubarrayRange.rangeEnd)&& - Objects.equals(this.additionalProperties, udFSubarrayRange.additionalProperties); + Objects.equals(this.rangeEnd, udFSubarrayRange.rangeEnd); } @Override public int hashCode() { - return Objects.hash(dimensionId, rangeStart, rangeEnd, additionalProperties); + return Objects.hash(dimensionId, rangeStart, rangeEnd); } @Override @@ -191,7 +151,6 @@ public String toString() { sb.append(" dimensionId: ").append(toIndentedString(dimensionId)).append("\n"); sb.append(" rangeStart: ").append(toIndentedString(rangeStart)).append("\n"); sb.append(" rangeEnd: ").append(toIndentedString(rangeEnd)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,27 +181,34 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UDFSubarrayRange - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (UDFSubarrayRange.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 UDFSubarrayRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UDFSubarrayRange.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UDFSubarrayRange is not found in the empty JSON string", UDFSubarrayRange.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UDFSubarrayRange.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UDFSubarrayRange` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `range_start` - if (jsonObj.getAsJsonObject("range_start") != null) { - DimensionCoordinate.validateJsonObject(jsonObj.getAsJsonObject("range_start")); + if (jsonObj.get("range_start") != null && !jsonObj.get("range_start").isJsonNull()) { + DimensionCoordinate.validateJsonElement(jsonObj.get("range_start")); } // validate the optional field `range_end` - if (jsonObj.getAsJsonObject("range_end") != null) { - DimensionCoordinate.validateJsonObject(jsonObj.getAsJsonObject("range_end")); + if (jsonObj.get("range_end") != null && !jsonObj.get("range_end").isJsonNull()) { + DimensionCoordinate.validateJsonElement(jsonObj.get("range_end")); } } @@ -261,71 +227,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UDFSubarrayRange value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public UDFSubarrayRange read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - UDFSubarrayRange instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of UDFSubarrayRange given an JSON string - * - * @param jsonString JSON string - * @return An instance of UDFSubarrayRange - * @throws IOException if the JSON string is invalid with respect to UDFSubarrayRange - */ + /** + * Create an instance of UDFSubarrayRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of UDFSubarrayRange + * @throws IOException if the JSON string is invalid with respect to UDFSubarrayRange + */ public static UDFSubarrayRange fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UDFSubarrayRange.class); } - /** - * Convert an instance of UDFSubarrayRange to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UDFSubarrayRange 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/model/UDFType.java b/src/main/java/io/tiledb/cloud/rest_api/model/UDFType.java index 5873b4f..5554783 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/UDFType.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/UDFType.java @@ -14,10 +14,11 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; +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; @@ -70,5 +71,10 @@ public UDFType read(final JsonReader jsonReader) throws IOException { return UDFType.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UDFType.fromValue(value); + } } diff --git a/src/main/java/io/tiledb/cloud/rest_api/model/User.java b/src/main/java/io/tiledb/cloud/rest_api/model/User.java index 7684a2d..3c333e6 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/User.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/User.java @@ -14,31 +14,40 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.AssetLocations; +import io.tiledb.cloud.rest_api.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationUser; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; - import org.openapitools.jackson.nullable.JsonNullable; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -46,8 +55,7 @@ /** * User */ -@ApiModel(description = "User") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class User { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,15 +99,15 @@ public class User { public static final String SERIALIZED_NAME_ORGANIZATIONS = "organizations"; @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) - private List organizations = null; + private List organizations = new ArrayList<>(); public static final String SERIALIZED_NAME_ALLOWED_ACTIONS = "allowed_actions"; @SerializedName(SERIALIZED_NAME_ALLOWED_ACTIONS) - private List allowedActions = null; + private List allowedActions = new ArrayList<>(); public static final String SERIALIZED_NAME_ENABLED_FEATURES = "enabled_features"; @SerializedName(SERIALIZED_NAME_ENABLED_FEATURES) - private List enabledFeatures = null; + private List enabledFeatures = new ArrayList<>(); public static final String SERIALIZED_NAME_UNPAID_SUBSCRIPTION = "unpaid_subscription"; @SerializedName(SERIALIZED_NAME_UNPAID_SUBSCRIPTION) @@ -125,10 +133,9 @@ public class User { @SerializedName(SERIALIZED_NAME_DEFAULT_REGION) private String defaultRegion; - public User() { + public User() { } - public User( Boolean isValidEmail, Boolean stripeConnect, @@ -145,233 +152,191 @@ public User( } public User id(String id) { - this.id = id; return this; } - /** + /** * unique ID of user * @return id - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "unique ID of user") - public String getId() { return id; } - public void setId(String id) { this.id = id; } public User username(String username) { - this.username = username; return this; } - /** + /** * username must be unique * @return username - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(example = "username", required = true, value = "username must be unique") - public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } public User password(String password) { - this.password = password; return this; } - /** + /** * password * @return password - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "password", value = "password") - public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } public User name(String name) { - this.name = name; return this; } - /** + /** * the user's full, real name * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "Jane Doe", value = "the user's full, real name") - public String getName() { return name; } - public void setName(String name) { this.name = name; } public User email(String email) { - this.email = email; return this; } - /** + /** * the user's email * @return email - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "jane.doe@example.com", value = "the user's email") - public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - /** + /** * user's email is validated to be correct * @return isValidEmail - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "user's email is validated to be correct") - public Boolean getIsValidEmail() { return isValidEmail; } - - /** + /** * Denotes that the user is able to apply pricing to arrays by means of Stripe Connect * @return stripeConnect - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "Denotes that the user is able to apply pricing to arrays by means of Stripe Connect") - public Boolean getStripeConnect() { return stripeConnect; } - public User company(String company) { - this.company = company; return this; } - /** + /** * the user's company * @return company - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "TileDB", value = "the user's company") - public String getCompany() { return company; } - public void setCompany(String company) { this.company = company; } public User logo(String logo) { - this.logo = logo; return this; } - /** + /** * the user's logo * @return logo - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "the user's logo") - public String getLogo() { return logo; } - public void setLogo(String logo) { this.logo = logo; } public User timezone(String timezone) { - this.timezone = timezone; return this; } - /** + /** * Get timezone * @return timezone - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(example = "Europe/Athens", value = "") - public String getTimezone() { return timezone; } - public void setTimezone(String timezone) { this.timezone = timezone; } - /** + /** * Array of organizations a user is part of and their roles * @return organizations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Array of organizations a user is part of and their roles") - public List getOrganizations() { return organizations; } - public User allowedActions(List allowedActions) { - this.allowedActions = allowedActions; return this; } @@ -384,200 +349,136 @@ public User addAllowedActionsItem(NamespaceActions allowedActionsItem) { return this; } - /** + /** * list of actions user is allowed to do on this organization * @return allowedActions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "list of actions user is allowed to do on this organization") - public List getAllowedActions() { return allowedActions; } - public void setAllowedActions(List allowedActions) { this.allowedActions = allowedActions; } - /** + /** * List of extra/optional/beta features to enable for namespace * @return enabledFeatures - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "List of extra/optional/beta features to enable for namespace") - public List getEnabledFeatures() { return enabledFeatures; } - - /** + /** * A notice that the user has an unpaid subscription * @return unpaidSubscription - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A notice that the user has an unpaid subscription") - public Boolean getUnpaidSubscription() { return unpaidSubscription; } - public User defaultS3Path(String defaultS3Path) { - this.defaultS3Path = defaultS3Path; return this; } - /** + /** * 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. * @return defaultS3Path - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "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. ") - public String getDefaultS3Path() { return defaultS3Path; } - public void setDefaultS3Path(String defaultS3Path) { this.defaultS3Path = defaultS3Path; } public User defaultS3PathCredentialsName(Object defaultS3PathCredentialsName) { - this.defaultS3PathCredentialsName = defaultS3PathCredentialsName; return this; } - /** + /** * The name of the credentials used to create and access files in the `default_s3_path`, if needed. * @return defaultS3PathCredentialsName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the credentials used to create and access files in the `default_s3_path`, if needed. ") - public Object getDefaultS3PathCredentialsName() { return defaultS3PathCredentialsName; } - public void setDefaultS3PathCredentialsName(Object defaultS3PathCredentialsName) { this.defaultS3PathCredentialsName = defaultS3PathCredentialsName; } public User assetLocations(AssetLocations assetLocations) { - this.assetLocations = assetLocations; return this; } - /** + /** * Get assetLocations * @return assetLocations - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public AssetLocations getAssetLocations() { return assetLocations; } - public void setAssetLocations(AssetLocations assetLocations) { this.assetLocations = assetLocations; } public User defaultNamespaceCharged(String defaultNamespaceCharged) { - this.defaultNamespaceCharged = defaultNamespaceCharged; return this; } - /** + /** * Override the default namespace charged for actions when no namespace is specified * @return defaultNamespaceCharged - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Override the default namespace charged for actions when no namespace is specified") - public String getDefaultNamespaceCharged() { return defaultNamespaceCharged; } - public void setDefaultNamespaceCharged(String defaultNamespaceCharged) { this.defaultNamespaceCharged = defaultNamespaceCharged; } public User defaultRegion(String defaultRegion) { - this.defaultRegion = defaultRegion; return this; } - /** + /** * 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 * @return defaultRegion - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "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 ") - public String getDefaultRegion() { return defaultRegion; } - public void setDefaultRegion(String defaultRegion) { this.defaultRegion = defaultRegion; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public User putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -607,8 +508,7 @@ public boolean equals(Object o) { Objects.equals(this.defaultS3PathCredentialsName, user.defaultS3PathCredentialsName) && Objects.equals(this.assetLocations, user.assetLocations) && Objects.equals(this.defaultNamespaceCharged, user.defaultNamespaceCharged) && - Objects.equals(this.defaultRegion, user.defaultRegion)&& - Objects.equals(this.additionalProperties, user.additionalProperties); + Objects.equals(this.defaultRegion, user.defaultRegion); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -617,7 +517,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, username, password, name, email, isValidEmail, stripeConnect, company, logo, timezone, organizations, allowedActions, enabledFeatures, unpaidSubscription, defaultS3Path, defaultS3PathCredentialsName, assetLocations, defaultNamespaceCharged, defaultRegion, additionalProperties); + return Objects.hash(id, username, password, name, email, isValidEmail, stripeConnect, company, logo, timezone, organizations, allowedActions, enabledFeatures, unpaidSubscription, defaultS3Path, defaultS3PathCredentialsName, assetLocations, defaultNamespaceCharged, defaultRegion); } private static int hashCodeNullable(JsonNullable a) { @@ -650,7 +550,6 @@ public String toString() { sb.append(" assetLocations: ").append(toIndentedString(assetLocations)).append("\n"); sb.append(" defaultNamespaceCharged: ").append(toIndentedString(defaultNamespaceCharged)).append("\n"); sb.append(" defaultRegion: ").append(toIndentedString(defaultRegion)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -698,27 +597,93 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("username"); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to User - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (User.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 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 (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (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") != 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())); + } + 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") != null && !jsonObj.get("password").isJsonNull()) && !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("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("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("company") != null && !jsonObj.get("company").isJsonNull()) && !jsonObj.get("company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString())); + } + if ((jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonNull()) && !jsonObj.get("logo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").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("organizations") != null && !jsonObj.get("organizations").isJsonNull()) { + JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("organizations"); + if (jsonArrayorganizations != null) { + // ensure the json data is an array + if (!jsonObj.get("organizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `organizations` to be an array in the JSON string but got `%s`", jsonObj.get("organizations").toString())); + } + + // validate the optional field `organizations` (array) + for (int i = 0; i < jsonArrayorganizations.size(); i++) { + OrganizationUser.validateJsonElement(jsonArrayorganizations.get(i)); + }; + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_actions") != null && !jsonObj.get("allowed_actions").isJsonNull() && !jsonObj.get("allowed_actions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowed_actions` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_actions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("enabled_features") != null && !jsonObj.get("enabled_features").isJsonNull() && !jsonObj.get("enabled_features").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `enabled_features` to be an array in the JSON string but got `%s`", jsonObj.get("enabled_features").toString())); + } + if ((jsonObj.get("default_s3_path") != null && !jsonObj.get("default_s3_path").isJsonNull()) && !jsonObj.get("default_s3_path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `default_s3_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_s3_path").toString())); + } + // validate the optional field `asset_locations` + if (jsonObj.get("asset_locations") != null && !jsonObj.get("asset_locations").isJsonNull()) { + AssetLocations.validateJsonElement(jsonObj.get("asset_locations")); + } + if ((jsonObj.get("default_namespace_charged") != null && !jsonObj.get("default_namespace_charged").isJsonNull()) && !jsonObj.get("default_namespace_charged").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `default_namespace_charged` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_namespace_charged").toString())); + } + if ((jsonObj.get("default_region") != null && !jsonObj.get("default_region").isJsonNull()) && !jsonObj.get("default_region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `default_region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("default_region").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -736,71 +701,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, User value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public User read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - User instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + 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 - */ + /** + * 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 - */ + /** + * 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/model/Writer.java b/src/main/java/io/tiledb/cloud/rest_api/model/Writer.java index 68533b4..86fc3d6 100644 --- a/src/main/java/io/tiledb/cloud/rest_api/model/Writer.java +++ b/src/main/java/io/tiledb/cloud/rest_api/model/Writer.java @@ -14,25 +14,35 @@ package io.tiledb.cloud.rest_api.model; import java.util.Objects; -import java.util.Arrays; import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModelProperty; +import io.tiledb.cloud.rest_api.model.DomainArray; 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.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.tiledb.cloud.rest_api.JSON; @@ -40,7 +50,7 @@ /** * Writer */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-08T21:39:23.775746+03:00[Europe/Athens]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Writer { public static final String SERIALIZED_NAME_CHECK_COORD_DUPS = "checkCoordDups"; @SerializedName(SERIALIZED_NAME_CHECK_COORD_DUPS) @@ -58,135 +68,84 @@ public class Writer { @SerializedName(SERIALIZED_NAME_SUBARRAY) private DomainArray subarray; - public Writer() { + public Writer() { } public Writer checkCoordDups(Boolean checkCoordDups) { - this.checkCoordDups = checkCoordDups; return this; } - /** + /** * Get checkCoordDups * @return checkCoordDups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getCheckCoordDups() { return checkCoordDups; } - public void setCheckCoordDups(Boolean checkCoordDups) { this.checkCoordDups = checkCoordDups; } public Writer checkCoordOOB(Boolean checkCoordOOB) { - this.checkCoordOOB = checkCoordOOB; return this; } - /** + /** * Get checkCoordOOB * @return checkCoordOOB - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getCheckCoordOOB() { return checkCoordOOB; } - public void setCheckCoordOOB(Boolean checkCoordOOB) { this.checkCoordOOB = checkCoordOOB; } public Writer dedupCoords(Boolean dedupCoords) { - this.dedupCoords = dedupCoords; return this; } - /** + /** * Get dedupCoords * @return dedupCoords - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Boolean getDedupCoords() { return dedupCoords; } - public void setDedupCoords(Boolean dedupCoords) { this.dedupCoords = dedupCoords; } public Writer subarray(DomainArray subarray) { - this.subarray = subarray; return this; } - /** + /** * Get subarray * @return subarray - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DomainArray getSubarray() { return subarray; } - public void setSubarray(DomainArray subarray) { this.subarray = subarray; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public Writer putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } @Override @@ -201,13 +160,12 @@ public boolean equals(Object o) { return Objects.equals(this.checkCoordDups, writer.checkCoordDups) && Objects.equals(this.checkCoordOOB, writer.checkCoordOOB) && Objects.equals(this.dedupCoords, writer.dedupCoords) && - Objects.equals(this.subarray, writer.subarray)&& - Objects.equals(this.additionalProperties, writer.additionalProperties); + Objects.equals(this.subarray, writer.subarray); } @Override public int hashCode() { - return Objects.hash(checkCoordDups, checkCoordOOB, dedupCoords, subarray, additionalProperties); + return Objects.hash(checkCoordDups, checkCoordOOB, dedupCoords, subarray); } @Override @@ -218,7 +176,6 @@ public String toString() { sb.append(" checkCoordOOB: ").append(toIndentedString(checkCoordOOB)).append("\n"); sb.append(" dedupCoords: ").append(toIndentedString(dedupCoords)).append("\n"); sb.append(" subarray: ").append(toIndentedString(subarray)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -250,23 +207,30 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Writer - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Writer.openapiRequiredFields.isEmpty()) { - return; - } else { // has required 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 Writer + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Writer.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in Writer is not found in the empty JSON string", Writer.openapiRequiredFields.toString())); } } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Writer.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Writer` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `subarray` - if (jsonObj.getAsJsonObject("subarray") != null) { - DomainArray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + if (jsonObj.get("subarray") != null && !jsonObj.get("subarray").isJsonNull()) { + DomainArray.validateJsonElement(jsonObj.get("subarray")); } } @@ -285,71 +249,36 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Writer value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } elementAdapter.write(out, obj); } @Override public Writer read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - Writer instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } - /** - * Create an instance of Writer given an JSON string - * - * @param jsonString JSON string - * @return An instance of Writer - * @throws IOException if the JSON string is invalid with respect to Writer - */ + /** + * Create an instance of Writer given an JSON string + * + * @param jsonString JSON string + * @return An instance of Writer + * @throws IOException if the JSON string is invalid with respect to Writer + */ public static Writer fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Writer.class); } - /** - * Convert an instance of Writer to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Writer 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/v2/ApiCallback.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiCallback.java new file mode 100644 index 0000000..e09c86a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiCallback.java @@ -0,0 +1,60 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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/v2/ApiClient.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiClient.java new file mode 100644 index 0000000..e22f311 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiClient.java @@ -0,0 +1,1555 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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 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.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.regex.Matcher; +import java.util.regex.Pattern; + +import io.tiledb.cloud.rest_api.v2.auth.Authentication; +import io.tiledb.cloud.rest_api.v2.auth.HttpBasicAuth; +import io.tiledb.cloud.rest_api.v2.auth.ApiKeyAuth; +import io.tiledb.cloud.rest_api.v2.auth.OAuth; +import io.tiledb.cloud.rest_api.v2.auth.RetryingOAuth; +import io.tiledb.cloud.rest_api.v2.auth.OAuthFlow; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "/v2"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); + authentications.put("BasicAuth", new HttpBasicAuth()); + 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("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); + authentications.put("BasicAuth", new HttpBasicAuth()); + 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("ApiKeyAuth", new ApiKeyAuth("header", "X-TILEDB-REST-API-KEY")); + authentications.put("BasicAuth", new HttpBasicAuth()); + + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.4.0/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 /v2 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + 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 ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.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!"); + } + + /** + * 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(String.valueOf(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 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.replaceAll(".*[/\\\\]", ""); + } + + /** + * 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 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * 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 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 { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws 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 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 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 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 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 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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 { + url.append(basePath).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 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 { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + } + } + 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 + */ + private 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)); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private 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. + */ + private 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" + Integer.toString(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); + } + } + + private 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 request The HTTP request object + * @return The string representation of the HTTP request body + * @throws ApiException If fail to serialize the request body object into a string + */ + private 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/v2/ApiException.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiException.java new file mode 100644 index 0000000..0e12b5b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiException.java @@ -0,0 +1,166 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +import java.util.Map; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ApiException extends Exception { + 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((String) null, (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/v2/ApiResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiResponse.java new file mode 100644 index 0000000..4c840f4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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/v2/Configuration.java b/src/main/java/io/tiledb/cloud/rest_api/v2/Configuration.java new file mode 100644 index 0000000..94174cf --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/Configuration.java @@ -0,0 +1,39 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * 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() { + return defaultApiClient; + } + + /** + * 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 = apiClient; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/GzipRequestInterceptor.java b/src/main/java/io/tiledb/cloud/rest_api/v2/GzipRequestInterceptor.java new file mode 100644 index 0000000..16165d1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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/v2/JSON.java b/src/main/java/io/tiledb/cloud/rest_api/v2/JSON.java new file mode 100644 index 0000000..dff2d96 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/JSON.java @@ -0,0 +1,537 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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.tiledb.cloud.rest_api.v2.model.AWSCredential; +import io.tiledb.cloud.rest_api.v2.model.AWSRole; +import io.tiledb.cloud.rest_api.v2.model.AccessCredential; +import io.tiledb.cloud.rest_api.v2.model.AccessCredentialCredential; +import io.tiledb.cloud.rest_api.v2.model.AccessCredentialRole; +import io.tiledb.cloud.rest_api.v2.model.AccessCredentialToken; +import io.tiledb.cloud.rest_api.v2.model.AccessCredentialsData; +import io.tiledb.cloud.rest_api.v2.model.Array; +import io.tiledb.cloud.rest_api.v2.model.ArrayActivityLog; +import io.tiledb.cloud.rest_api.v2.model.ArrayActivityLogData; +import io.tiledb.cloud.rest_api.v2.model.ArrayDirectory; +import io.tiledb.cloud.rest_api.v2.model.ArrayFetch; +import io.tiledb.cloud.rest_api.v2.model.ArrayMetadata; +import io.tiledb.cloud.rest_api.v2.model.ArrayMetadataEntry; +import io.tiledb.cloud.rest_api.v2.model.ArraySchema; +import io.tiledb.cloud.rest_api.v2.model.ArraySchemaEntry; +import io.tiledb.cloud.rest_api.v2.model.ArraySchemaMap; +import io.tiledb.cloud.rest_api.v2.model.Attribute; +import io.tiledb.cloud.rest_api.v2.model.AttributeBufferHeader; +import io.tiledb.cloud.rest_api.v2.model.AttributeBufferSize; +import io.tiledb.cloud.rest_api.v2.model.AzureCredential; +import io.tiledb.cloud.rest_api.v2.model.AzureToken; +import io.tiledb.cloud.rest_api.v2.model.DeleteAndUpdateTileLocation; +import io.tiledb.cloud.rest_api.v2.model.Dimension; +import io.tiledb.cloud.rest_api.v2.model.DimensionTileExtent; +import io.tiledb.cloud.rest_api.v2.model.Domain; +import io.tiledb.cloud.rest_api.v2.model.DomainArray; +import io.tiledb.cloud.rest_api.v2.model.Error; +import io.tiledb.cloud.rest_api.v2.model.FileUploaded; +import io.tiledb.cloud.rest_api.v2.model.Filter; +import io.tiledb.cloud.rest_api.v2.model.FilterData; +import io.tiledb.cloud.rest_api.v2.model.FilterPipeline; +import io.tiledb.cloud.rest_api.v2.model.FloatScaleConfig; +import io.tiledb.cloud.rest_api.v2.model.FragmentMetadata; +import io.tiledb.cloud.rest_api.v2.model.GCPInteroperabilityCredential; +import io.tiledb.cloud.rest_api.v2.model.GCPServiceAccountKey; +import io.tiledb.cloud.rest_api.v2.model.GenericTileOffsets; +import io.tiledb.cloud.rest_api.v2.model.GroupContentActivity; +import io.tiledb.cloud.rest_api.v2.model.GroupContentActivityAsset; +import io.tiledb.cloud.rest_api.v2.model.GroupContentActivityResponse; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsChangesRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsChangesRequestGroupChanges; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsRetrievalRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsRetrievalResponse; +import io.tiledb.cloud.rest_api.v2.model.GroupCreationRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupCreationRequestGroupDetails; +import io.tiledb.cloud.rest_api.v2.model.GroupCreationResponse; +import io.tiledb.cloud.rest_api.v2.model.GroupMember; +import io.tiledb.cloud.rest_api.v2.model.GroupMetadataRetrievalRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupMetadataUpdateRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupRegistrationRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupRegistrationRequestGroupDetails; +import io.tiledb.cloud.rest_api.v2.model.Metadata; +import io.tiledb.cloud.rest_api.v2.model.MetadataEntry; +import io.tiledb.cloud.rest_api.v2.model.NonEmptyDomain; +import io.tiledb.cloud.rest_api.v2.model.NonEmptyDomainList; +import io.tiledb.cloud.rest_api.v2.model.NotebookUploaded; +import io.tiledb.cloud.rest_api.v2.model.PaginationMetadata; +import io.tiledb.cloud.rest_api.v2.model.Query; +import io.tiledb.cloud.rest_api.v2.model.QueryReader; +import io.tiledb.cloud.rest_api.v2.model.ReadState; +import io.tiledb.cloud.rest_api.v2.model.Subarray; +import io.tiledb.cloud.rest_api.v2.model.SubarrayPartitioner; +import io.tiledb.cloud.rest_api.v2.model.SubarrayPartitionerCurrent; +import io.tiledb.cloud.rest_api.v2.model.SubarrayPartitionerState; +import io.tiledb.cloud.rest_api.v2.model.SubarrayRanges; +import io.tiledb.cloud.rest_api.v2.model.TileDBConfig; +import io.tiledb.cloud.rest_api.v2.model.TileDBConfigEntriesInner; +import io.tiledb.cloud.rest_api.v2.model.TimestampedURI; +import io.tiledb.cloud.rest_api.v2.model.Writer; +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +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.Map; + +/* + * 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; + } + + { + 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 AWSCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AWSRole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AccessCredentialCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AccessCredentialRole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AccessCredentialToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AccessCredentialsData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Array.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArrayActivityLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArrayActivityLogData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArrayDirectory.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArrayFetch.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArrayMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArrayMetadataEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArraySchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArraySchemaEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ArraySchemaMap.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Attribute.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AttributeBufferHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AttributeBufferSize.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AzureCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new AzureToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new DeleteAndUpdateTileLocation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Dimension.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new DimensionTileExtent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Domain.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new DomainArray.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Error.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new FileUploaded.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Filter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new FilterData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new FilterPipeline.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new FloatScaleConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new FragmentMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GCPInteroperabilityCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GCPServiceAccountKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GenericTileOffsets.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentActivity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentActivityAsset.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentActivityResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentsChangesRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentsChangesRequestGroupChanges.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentsRetrievalRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupContentsRetrievalResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupCreationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupCreationRequestGroupDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupCreationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupMember.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupMetadataRetrievalRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupMetadataUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupRegistrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new GroupRegistrationRequestGroupDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Metadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new MetadataEntry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new NonEmptyDomain.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new NonEmptyDomainList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new NotebookUploaded.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new PaginationMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Query.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new QueryReader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ReadState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Subarray.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new SubarrayPartitioner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new SubarrayPartitionerCurrent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new SubarrayPartitionerState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new SubarrayRanges.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new TileDBConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new TileDBConfigEntriesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new TimestampedURI.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new Writer.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); + } + } + } + + /** + * 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/v2/Pair.java b/src/main/java/io/tiledb/cloud/rest_api/v2/Pair.java new file mode 100644 index 0000000..6fdfcd9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/Pair.java @@ -0,0 +1,57 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/ProgressRequestBody.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ProgressRequestBody.java new file mode 100644 index 0000000..b7e9eb4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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/v2/ProgressResponseBody.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ProgressResponseBody.java new file mode 100644 index 0000000..1520273 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +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/v2/ServerConfiguration.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ServerConfiguration.java new file mode 100644 index 0000000..b8cddf4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ServerConfiguration.java @@ -0,0 +1,58 @@ +package io.tiledb.cloud.rest_api.v2; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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.replaceAll("\\{" + 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/v2/ServerVariable.java b/src/main/java/io/tiledb/cloud/rest_api/v2/ServerVariable.java new file mode 100644 index 0000000..1e54533 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/ServerVariable.java @@ -0,0 +1,23 @@ +package io.tiledb.cloud.rest_api.v2; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/v2/StringUtil.java b/src/main/java/io/tiledb/cloud/rest_api/v2/StringUtil.java new file mode 100644 index 0000000..310fcbb --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +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/v2/api/ArrayApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/ArrayApi.java new file mode 100644 index 0000000..fbfb690 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/ArrayApi.java @@ -0,0 +1,440 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.model.Array; +import io.tiledb.cloud.rest_api.v2.model.ArrayActivityLogData; +import io.tiledb.cloud.rest_api.v2.model.ArrayFetch; +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ArrayApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ArrayApi() { + this(Configuration.getDefaultApiClient()); + } + + public ArrayApi(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 arrayActivityLog + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param start Start time of window of fetch logs, unix epoch in seconds (default: seven days ago) (optional) + * @param end End time of window of fetch logs, unix epoch in seconds (default: current utc timestamp) (optional) + * @param eventTypes Refer to ActivityEventType for possible values (optional) + * @param taskId Array task id To filter activity to (optional) + * @param hasTaskId Excludes activity log results that does not contain an array task uuid (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 + + + + + +
Status Code Description Response Headers
200 log of array activity -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call arrayActivityLogCall(String namespace, String array, Integer start, Integer end, List eventTypes, String taskId, Boolean hasTaskId, Integer page, 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 = "/arrays/{namespace}/{array}/activity" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (start != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start", start)); + } + + if (end != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end", end)); + } + + if (eventTypes != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "event_types", eventTypes)); + } + + if (taskId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("task_id", taskId)); + } + + if (hasTaskId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("has_task_id", hasTaskId)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call arrayActivityLogValidateBeforeCall(String namespace, String array, Integer start, Integer end, List eventTypes, String taskId, Boolean hasTaskId, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling arrayActivityLog(Async)"); + } + + // verify the required parameter 'array' is set + if (array == null) { + throw new ApiException("Missing the required parameter 'array' when calling arrayActivityLog(Async)"); + } + + + okhttp3.Call localVarCall = arrayActivityLogCall(namespace, array, start, end, eventTypes, taskId, hasTaskId, page, perPage, _callback); + return localVarCall; + + } + + /** + * + * get array activity logs + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param start Start time of window of fetch logs, unix epoch in seconds (default: seven days ago) (optional) + * @param end End time of window of fetch logs, unix epoch in seconds (default: current utc timestamp) (optional) + * @param eventTypes Refer to ActivityEventType for possible values (optional) + * @param taskId Array task id To filter activity to (optional) + * @param hasTaskId Excludes activity log results that does not contain an array task uuid (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ArrayActivityLogData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 log of array activity -
502 Bad Gateway -
0 error response -
+ */ + public ArrayActivityLogData arrayActivityLog(String namespace, String array, Integer start, Integer end, List eventTypes, String taskId, Boolean hasTaskId, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = arrayActivityLogWithHttpInfo(namespace, array, start, end, eventTypes, taskId, hasTaskId, page, perPage); + return localVarResp.getData(); + } + + /** + * + * get array activity logs + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param start Start time of window of fetch logs, unix epoch in seconds (default: seven days ago) (optional) + * @param end End time of window of fetch logs, unix epoch in seconds (default: current utc timestamp) (optional) + * @param eventTypes Refer to ActivityEventType for possible values (optional) + * @param taskId Array task id To filter activity to (optional) + * @param hasTaskId Excludes activity log results that does not contain an array task uuid (optional) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<ArrayActivityLogData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 log of array activity -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse arrayActivityLogWithHttpInfo(String namespace, String array, Integer start, Integer end, List eventTypes, String taskId, Boolean hasTaskId, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = arrayActivityLogValidateBeforeCall(namespace, array, start, end, eventTypes, taskId, hasTaskId, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * get array activity logs + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param start Start time of window of fetch logs, unix epoch in seconds (default: seven days ago) (optional) + * @param end End time of window of fetch logs, unix epoch in seconds (default: current utc timestamp) (optional) + * @param eventTypes Refer to ActivityEventType for possible values (optional) + * @param taskId Array task id To filter activity to (optional) + * @param hasTaskId Excludes activity log results that does not contain an array task uuid (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 + + + + + +
Status Code Description Response Headers
200 log of array activity -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call arrayActivityLogAsync(String namespace, String array, Integer start, Integer end, List eventTypes, String taskId, Boolean hasTaskId, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = arrayActivityLogValidateBeforeCall(namespace, array, start, end, eventTypes, taskId, hasTaskId, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getArray + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input and return mime (required) + * @param arrayFetch Details for array being fetched (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Array opened successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getArrayCall(String namespace, String array, String contentType, ArrayFetch arrayFetch, 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 = arrayFetch; + + // create path and map variables + String localVarPath = "/arrays/{namespace}/{array}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (contentType != null) { + localVarHeaderParams.put("Content-Type", localVarApiClient.parameterToString(contentType)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getArrayValidateBeforeCall(String namespace, String array, String contentType, ArrayFetch arrayFetch, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling getArray(Async)"); + } + + // verify the required parameter 'array' is set + if (array == null) { + throw new ApiException("Missing the required parameter 'array' when calling getArray(Async)"); + } + + // verify the required parameter 'contentType' is set + if (contentType == null) { + throw new ApiException("Missing the required parameter 'contentType' when calling getArray(Async)"); + } + + // verify the required parameter 'arrayFetch' is set + if (arrayFetch == null) { + throw new ApiException("Missing the required parameter 'arrayFetch' when calling getArray(Async)"); + } + + + okhttp3.Call localVarCall = getArrayCall(namespace, array, contentType, arrayFetch, _callback); + return localVarCall; + + } + + /** + * + * Get a array at a specified URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input and return mime (required) + * @param arrayFetch Details for array being fetched (required) + * @return Array + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Array opened successfully -
502 Bad Gateway -
0 error response -
+ */ + public Array getArray(String namespace, String array, String contentType, ArrayFetch arrayFetch) throws ApiException { + ApiResponse localVarResp = getArrayWithHttpInfo(namespace, array, contentType, arrayFetch); + return localVarResp.getData(); + } + + /** + * + * Get a array at a specified URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input and return mime (required) + * @param arrayFetch Details for array being fetched (required) + * @return ApiResponse<Array> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Array opened successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse getArrayWithHttpInfo(String namespace, String array, String contentType, ArrayFetch arrayFetch) throws ApiException { + okhttp3.Call localVarCall = getArrayValidateBeforeCall(namespace, array, contentType, arrayFetch, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a array at a specified URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input and return mime (required) + * @param arrayFetch Details for array being fetched (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Array opened successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getArrayAsync(String namespace, String array, String contentType, ArrayFetch arrayFetch, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getArrayValidateBeforeCall(namespace, array, contentType, arrayFetch, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/api/FilesApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/FilesApi.java new file mode 100644 index 0000000..56cf90e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/FilesApi.java @@ -0,0 +1,284 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.model.FileUploaded; +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +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 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 handleUploadFile + * @param namespace The namespace of the file (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input (required) + * @param filesize size of the file to upload in bytes (required) + * @param _file file to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @param filename original file name (optional) + * @param mimetype Mime type of the uploaded file. Autogenerated clients do not always support changing the content type param. Server will always use mimetype query param to set mimetype for file, if it is not set Content-Type will be used (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 File uploaded -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call handleUploadFileCall(String namespace, String array, String contentType, Integer filesize, File _file, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, String filename, String mimetype, 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 = _file; + + // create path and map variables + String localVarPath = "/files/{namespace}/{array}/upload" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (name != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name)); + } + + if (filename != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filename", filename)); + } + + if (filesize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filesize", filesize)); + } + + if (mimetype != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("mimetype", mimetype)); + } + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + if (contentType != null) { + localVarHeaderParams.put("Content-Type", localVarApiClient.parameterToString(contentType)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/octet-stream" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call handleUploadFileValidateBeforeCall(String namespace, String array, String contentType, Integer filesize, File _file, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, String filename, String mimetype, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling handleUploadFile(Async)"); + } + + // verify the required parameter 'array' is set + if (array == null) { + throw new ApiException("Missing the required parameter 'array' when calling handleUploadFile(Async)"); + } + + // verify the required parameter 'contentType' is set + if (contentType == null) { + throw new ApiException("Missing the required parameter 'contentType' when calling handleUploadFile(Async)"); + } + + // verify the required parameter 'filesize' is set + if (filesize == null) { + throw new ApiException("Missing the required parameter 'filesize' when calling handleUploadFile(Async)"); + } + + // verify the required parameter '_file' is set + if (_file == null) { + throw new ApiException("Missing the required parameter '_file' when calling handleUploadFile(Async)"); + } + + + okhttp3.Call localVarCall = handleUploadFileCall(namespace, array, contentType, filesize, _file, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, filename, mimetype, _callback); + return localVarCall; + + } + + /** + * + * Upload a file at the specified location and wrap it in TileDB Array + * @param namespace The namespace of the file (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input (required) + * @param filesize size of the file to upload in bytes (required) + * @param _file file to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @param filename original file name (optional) + * @param mimetype Mime type of the uploaded file. Autogenerated clients do not always support changing the content type param. Server will always use mimetype query param to set mimetype for file, if it is not set Content-Type will be used (optional) + * @return FileUploaded + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 File uploaded -
502 Bad Gateway -
0 error response -
+ */ + public FileUploaded handleUploadFile(String namespace, String array, String contentType, Integer filesize, File _file, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, String filename, String mimetype) throws ApiException { + ApiResponse localVarResp = handleUploadFileWithHttpInfo(namespace, array, contentType, filesize, _file, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, filename, mimetype); + return localVarResp.getData(); + } + + /** + * + * Upload a file at the specified location and wrap it in TileDB Array + * @param namespace The namespace of the file (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input (required) + * @param filesize size of the file to upload in bytes (required) + * @param _file file to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @param filename original file name (optional) + * @param mimetype Mime type of the uploaded file. Autogenerated clients do not always support changing the content type param. Server will always use mimetype query param to set mimetype for file, if it is not set Content-Type will be used (optional) + * @return ApiResponse<FileUploaded> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 File uploaded -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse handleUploadFileWithHttpInfo(String namespace, String array, String contentType, Integer filesize, File _file, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, String filename, String mimetype) throws ApiException { + okhttp3.Call localVarCall = handleUploadFileValidateBeforeCall(namespace, array, contentType, filesize, _file, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, filename, mimetype, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Upload a file at the specified location and wrap it in TileDB Array + * @param namespace The namespace of the file (required) + * @param array name/uri of array that is url-encoded (required) + * @param contentType Content Type of input (required) + * @param filesize size of the file to upload in bytes (required) + * @param _file file to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @param filename original file name (optional) + * @param mimetype Mime type of the uploaded file. Autogenerated clients do not always support changing the content type param. Server will always use mimetype query param to set mimetype for file, if it is not set Content-Type will be used (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 File uploaded -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call handleUploadFileAsync(String namespace, String array, String contentType, Integer filesize, File _file, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, String filename, String mimetype, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = handleUploadFileValidateBeforeCall(namespace, array, contentType, filesize, _file, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, filename, mimetype, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/api/GroupsApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/GroupsApi.java new file mode 100644 index 0000000..3279add --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/GroupsApi.java @@ -0,0 +1,1593 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.model.GroupContentActivityResponse; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsChangesRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsRetrievalRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupContentsRetrievalResponse; +import io.tiledb.cloud.rest_api.v2.model.GroupCreationRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupCreationResponse; +import io.tiledb.cloud.rest_api.v2.model.GroupMetadataRetrievalRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupMetadataUpdateRequest; +import io.tiledb.cloud.rest_api.v2.model.GroupRegistrationRequest; +import io.tiledb.cloud.rest_api.v2.model.Metadata; +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GroupsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public GroupsApi() { + this(Configuration.getDefaultApiClient()); + } + + public GroupsApi(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 createGroup + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupCreation (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call createGroupCall(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupCreationRequest groupCreation, 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 = groupCreation; + + // create path and map variables + String localVarPath = "/groups/{group_namespace}" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createGroupValidateBeforeCall(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupCreationRequest groupCreation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling createGroup(Async)"); + } + + + okhttp3.Call localVarCall = createGroupCall(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupCreation, _callback); + return localVarCall; + + } + + /** + * + * Creates an empty group + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupCreation (optional) + * @return GroupCreationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public GroupCreationResponse createGroup(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupCreationRequest groupCreation) throws ApiException { + ApiResponse localVarResp = createGroupWithHttpInfo(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupCreation); + return localVarResp.getData(); + } + + /** + * + * Creates an empty group + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupCreation (optional) + * @return ApiResponse<GroupCreationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse createGroupWithHttpInfo(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupCreationRequest groupCreation) throws ApiException { + okhttp3.Call localVarCall = createGroupValidateBeforeCall(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupCreation, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates an empty group + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupCreation (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call createGroupAsync(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupCreationRequest groupCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createGroupValidateBeforeCall(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupCreation, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteGroup + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param recursive If true, it descends in the group and deletes every subgroup and subarray (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call deleteGroupCall(String groupNamespace, String groupName, String recursive, 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 = "/groups/{group_namespace}/{group_name}/delete" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recursive != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recursive", recursive)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteGroupValidateBeforeCall(String groupNamespace, String groupName, String recursive, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling deleteGroup(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling deleteGroup(Async)"); + } + + + okhttp3.Call localVarCall = deleteGroupCall(groupNamespace, groupName, recursive, _callback); + return localVarCall; + + } + + /** + * + * Deregisters and physically deletes a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param recursive If true, it descends in the group and deletes every subgroup and subarray (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
502 Bad Gateway -
0 error response -
+ */ + public void deleteGroup(String groupNamespace, String groupName, String recursive) throws ApiException { + deleteGroupWithHttpInfo(groupNamespace, groupName, recursive); + } + + /** + * + * Deregisters and physically deletes a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param recursive If true, it descends in the group and deletes every subgroup and subarray (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 + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse deleteGroupWithHttpInfo(String groupNamespace, String groupName, String recursive) throws ApiException { + okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupNamespace, groupName, recursive, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Deregisters and physically deletes a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param recursive If true, it descends in the group and deletes every subgroup and subarray (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 group deleted successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call deleteGroupAsync(String groupNamespace, String groupName, String recursive, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteGroupValidateBeforeCall(groupNamespace, groupName, recursive, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deregisterGroup + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param recursive If true, it descends in the group and deregisters every subgroup and subarray (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group deregistered successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call deregisterGroupCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String recursive, 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 = "/groups/{group_namespace}/{group_name}" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recursive != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recursive", recursive)); + } + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deregisterGroupValidateBeforeCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String recursive, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling deregisterGroup(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling deregisterGroup(Async)"); + } + + + okhttp3.Call localVarCall = deregisterGroupCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, recursive, _callback); + return localVarCall; + + } + + /** + * + * Deregisters a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param recursive If true, it descends in the group and deregisters every subgroup and subarray (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group deregistered successfully -
502 Bad Gateway -
0 error response -
+ */ + public void deregisterGroup(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String recursive) throws ApiException { + deregisterGroupWithHttpInfo(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, recursive); + } + + /** + * + * Deregisters a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param recursive If true, it descends in the group and deregisters every subgroup and subarray (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 + + + + + +
Status Code Description Response Headers
200 group deregistered successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse deregisterGroupWithHttpInfo(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String recursive) throws ApiException { + okhttp3.Call localVarCall = deregisterGroupValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, recursive, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Deregisters a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param recursive If true, it descends in the group and deregisters every subgroup and subarray (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group deregistered successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call deregisterGroupAsync(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String recursive, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deregisterGroupValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, recursive, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getGroupContentActivity + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (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 + + + + + +
Status Code Description Response Headers
200 Activity logs of group contents along with the pagination metadata -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getGroupContentActivityCall(String groupNamespace, String groupName, Integer page, 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 = "/groups/{group_namespace}/{group_name}/content_activity" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGroupContentActivityValidateBeforeCall(String groupNamespace, String groupName, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling getGroupContentActivity(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling getGroupContentActivity(Async)"); + } + + + okhttp3.Call localVarCall = getGroupContentActivityCall(groupNamespace, groupName, page, perPage, _callback); + return localVarCall; + + } + + /** + * + * Retrieves combined activity logs for all assets contained in a group. + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return GroupContentActivityResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Activity logs of group contents along with the pagination metadata -
502 Bad Gateway -
0 error response -
+ */ + public GroupContentActivityResponse getGroupContentActivity(String groupNamespace, String groupName, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = getGroupContentActivityWithHttpInfo(groupNamespace, groupName, page, perPage); + return localVarResp.getData(); + } + + /** + * + * Retrieves combined activity logs for all assets contained in a group. + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param page pagination offset (optional) + * @param perPage pagination limit (optional) + * @return ApiResponse<GroupContentActivityResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Activity logs of group contents along with the pagination metadata -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse getGroupContentActivityWithHttpInfo(String groupNamespace, String groupName, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = getGroupContentActivityValidateBeforeCall(groupNamespace, groupName, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves combined activity logs for all assets contained in a group. + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (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 + + + + + +
Status Code Description Response Headers
200 Activity logs of group contents along with the pagination metadata -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getGroupContentActivityAsync(String groupNamespace, String groupName, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGroupContentActivityValidateBeforeCall(groupNamespace, groupName, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getGroupMetadata + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataRetrieval (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 retrieve metadata for a group -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getGroupMetadataCall(String groupNamespace, String groupName, GroupMetadataRetrievalRequest metadataRetrieval, 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 = metadataRetrieval; + + // create path and map variables + String localVarPath = "/groups/{group_namespace}/{group_name}/metadata" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getGroupMetadataValidateBeforeCall(String groupNamespace, String groupName, GroupMetadataRetrievalRequest metadataRetrieval, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling getGroupMetadata(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling getGroupMetadata(Async)"); + } + + + okhttp3.Call localVarCall = getGroupMetadataCall(groupNamespace, groupName, metadataRetrieval, _callback); + return localVarCall; + + } + + /** + * + * get metadata on a group using the requested config + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataRetrieval (optional) + * @return Metadata + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 retrieve metadata for a group -
502 Bad Gateway -
0 error response -
+ */ + public Metadata getGroupMetadata(String groupNamespace, String groupName, GroupMetadataRetrievalRequest metadataRetrieval) throws ApiException { + ApiResponse localVarResp = getGroupMetadataWithHttpInfo(groupNamespace, groupName, metadataRetrieval); + return localVarResp.getData(); + } + + /** + * + * get metadata on a group using the requested config + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataRetrieval (optional) + * @return ApiResponse<Metadata> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 retrieve metadata for a group -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse getGroupMetadataWithHttpInfo(String groupNamespace, String groupName, GroupMetadataRetrievalRequest metadataRetrieval) throws ApiException { + okhttp3.Call localVarCall = getGroupMetadataValidateBeforeCall(groupNamespace, groupName, metadataRetrieval, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * get metadata on a group using the requested config + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataRetrieval (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 retrieve metadata for a group -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getGroupMetadataAsync(String groupNamespace, String groupName, GroupMetadataRetrievalRequest metadataRetrieval, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getGroupMetadataValidateBeforeCall(groupNamespace, groupName, metadataRetrieval, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for groupsGroupNamespaceGroupNameOptions + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
404 the resource does not exist -
204 the resource exists -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call groupsGroupNamespaceGroupNameOptionsCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, 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 = "/groups/{group_namespace}/{group_name}" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "OPTIONS", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call groupsGroupNamespaceGroupNameOptionsValidateBeforeCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling groupsGroupNamespaceGroupNameOptions(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling groupsGroupNamespaceGroupNameOptions(Async)"); + } + + + okhttp3.Call localVarCall = groupsGroupNamespaceGroupNameOptionsCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); + return localVarCall; + + } + + /** + * + * can be used to check if the resource exists + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
404 the resource does not exist -
204 the resource exists -
502 Bad Gateway -
0 error response -
+ */ + public void groupsGroupNamespaceGroupNameOptions(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME) throws ApiException { + groupsGroupNamespaceGroupNameOptionsWithHttpInfo(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); + } + + /** + * + * can be used to check if the resource exists + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (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 + + + + + + +
Status Code Description Response Headers
404 the resource does not exist -
204 the resource exists -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse groupsGroupNamespaceGroupNameOptionsWithHttpInfo(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME) throws ApiException { + okhttp3.Call localVarCall = groupsGroupNamespaceGroupNameOptionsValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * can be used to check if the resource exists + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
404 the resource does not exist -
204 the resource exists -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call groupsGroupNamespaceGroupNameOptionsAsync(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = groupsGroupNamespaceGroupNameOptionsValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for registerGroup + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRegistration (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call registerGroupCall(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupRegistrationRequest groupRegistration, 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 = groupRegistration; + + // create path and map variables + String localVarPath = "/groups/{group_namespace}" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call registerGroupValidateBeforeCall(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupRegistrationRequest groupRegistration, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling registerGroup(Async)"); + } + + + okhttp3.Call localVarCall = registerGroupCall(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRegistration, _callback); + return localVarCall; + + } + + /** + * + * Registers an already existing group + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRegistration (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public void registerGroup(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupRegistrationRequest groupRegistration) throws ApiException { + registerGroupWithHttpInfo(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRegistration); + } + + /** + * + * Registers an already existing group + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRegistration (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 + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse registerGroupWithHttpInfo(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupRegistrationRequest groupRegistration) throws ApiException { + okhttp3.Call localVarCall = registerGroupValidateBeforeCall(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRegistration, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Registers an already existing group + * @param groupNamespace The namespace of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRegistration (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call registerGroupAsync(String groupNamespace, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupRegistrationRequest groupRegistration, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = registerGroupValidateBeforeCall(groupNamespace, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRegistration, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for retrieveGroup + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRetrieval (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call retrieveGroupCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsRetrievalRequest groupRetrieval, 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 = groupRetrieval; + + // create path and map variables + String localVarPath = "/groups/{group_namespace}/{group_name}" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call retrieveGroupValidateBeforeCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsRetrievalRequest groupRetrieval, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling retrieveGroup(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling retrieveGroup(Async)"); + } + + + okhttp3.Call localVarCall = retrieveGroupCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRetrieval, _callback); + return localVarCall; + + } + + /** + * + * Retrieves the contents of a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRetrieval (optional) + * @return GroupContentsRetrievalResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public GroupContentsRetrievalResponse retrieveGroup(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsRetrievalRequest groupRetrieval) throws ApiException { + ApiResponse localVarResp = retrieveGroupWithHttpInfo(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRetrieval); + return localVarResp.getData(); + } + + /** + * + * Retrieves the contents of a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRetrieval (optional) + * @return ApiResponse<GroupContentsRetrievalResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse retrieveGroupWithHttpInfo(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsRetrievalRequest groupRetrieval) throws ApiException { + okhttp3.Call localVarCall = retrieveGroupValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRetrieval, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves the contents of a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupRetrieval (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group created successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call retrieveGroupAsync(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsRetrievalRequest groupRetrieval, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = retrieveGroupValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupRetrieval, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateGroupContents + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupUpdateContents (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 attributes changed successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call updateGroupContentsCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsChangesRequest groupUpdateContents, 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 = groupUpdateContents; + + // create path and map variables + String localVarPath = "/groups/{group_namespace}/{group_name}" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateGroupContentsValidateBeforeCall(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsChangesRequest groupUpdateContents, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling updateGroupContents(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling updateGroupContents(Async)"); + } + + + okhttp3.Call localVarCall = updateGroupContentsCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupUpdateContents, _callback); + return localVarCall; + + } + + /** + * + * Change the contents of the group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupUpdateContents (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 attributes changed successfully -
502 Bad Gateway -
0 error response -
+ */ + public void updateGroupContents(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsChangesRequest groupUpdateContents) throws ApiException { + updateGroupContentsWithHttpInfo(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupUpdateContents); + } + + /** + * + * Change the contents of the group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupUpdateContents (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 + + + + + +
Status Code Description Response Headers
204 attributes changed successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse updateGroupContentsWithHttpInfo(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsChangesRequest groupUpdateContents) throws ApiException { + okhttp3.Call localVarCall = updateGroupContentsValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupUpdateContents, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Change the contents of the group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param groupUpdateContents (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 attributes changed successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call updateGroupContentsAsync(String groupNamespace, String groupName, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, GroupContentsChangesRequest groupUpdateContents, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateGroupContentsValidateBeforeCall(groupNamespace, groupName, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, groupUpdateContents, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateGroupMetadata + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataUpdating (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group metadata updated successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call updateGroupMetadataCall(String groupNamespace, String groupName, GroupMetadataUpdateRequest metadataUpdating, 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 = metadataUpdating; + + // create path and map variables + String localVarPath = "/groups/{group_namespace}/{group_name}/metadata" + .replaceAll("\\{" + "group_namespace" + "\\}", localVarApiClient.escapeString(groupNamespace.toString())) + .replaceAll("\\{" + "group_name" + "\\}", localVarApiClient.escapeString(groupName.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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateGroupMetadataValidateBeforeCall(String groupNamespace, String groupName, GroupMetadataUpdateRequest metadataUpdating, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'groupNamespace' is set + if (groupNamespace == null) { + throw new ApiException("Missing the required parameter 'groupNamespace' when calling updateGroupMetadata(Async)"); + } + + // verify the required parameter 'groupName' is set + if (groupName == null) { + throw new ApiException("Missing the required parameter 'groupName' when calling updateGroupMetadata(Async)"); + } + + + okhttp3.Call localVarCall = updateGroupMetadataCall(groupNamespace, groupName, metadataUpdating, _callback); + return localVarCall; + + } + + /** + * + * update metadata on a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataUpdating (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group metadata updated successfully -
502 Bad Gateway -
0 error response -
+ */ + public void updateGroupMetadata(String groupNamespace, String groupName, GroupMetadataUpdateRequest metadataUpdating) throws ApiException { + updateGroupMetadataWithHttpInfo(groupNamespace, groupName, metadataUpdating); + } + + /** + * + * update metadata on a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataUpdating (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 + + + + + +
Status Code Description Response Headers
200 group metadata updated successfully -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse updateGroupMetadataWithHttpInfo(String groupNamespace, String groupName, GroupMetadataUpdateRequest metadataUpdating) throws ApiException { + okhttp3.Call localVarCall = updateGroupMetadataValidateBeforeCall(groupNamespace, groupName, metadataUpdating, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * update metadata on a group + * @param groupNamespace The namespace of the group (required) + * @param groupName The unique name or id of the group (required) + * @param metadataUpdating (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 group metadata updated successfully -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call updateGroupMetadataAsync(String groupNamespace, String groupName, GroupMetadataUpdateRequest metadataUpdating, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateGroupMetadataValidateBeforeCall(groupNamespace, groupName, metadataUpdating, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/api/NotebooksApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/NotebooksApi.java new file mode 100644 index 0000000..597b6ab --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/NotebooksApi.java @@ -0,0 +1,255 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.model.NotebookUploaded; +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +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 NotebooksApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public NotebooksApi() { + this(Configuration.getDefaultApiClient()); + } + + public NotebooksApi(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 handleUploadNotebook + * @param namespace The namespace of the notebook (required) + * @param array name/uri of array that is url-encoded (required) + * @param filesize size of the notebook to upload in bytes (required) + * @param notebook notebook to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call handleUploadNotebookCall(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, 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 = notebook; + + // create path and map variables + String localVarPath = "/notebooks/{namespace}/{array}/upload" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (name != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name)); + } + + if (filesize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filesize", filesize)); + } + + if (X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME != null) { + localVarHeaderParams.put("X-TILEDB-CLOUD-ACCESS-CREDENTIALS-NAME", localVarApiClient.parameterToString(X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/octet-stream" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call handleUploadNotebookValidateBeforeCall(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling handleUploadNotebook(Async)"); + } + + // verify the required parameter 'array' is set + if (array == null) { + throw new ApiException("Missing the required parameter 'array' when calling handleUploadNotebook(Async)"); + } + + // verify the required parameter 'filesize' is set + if (filesize == null) { + throw new ApiException("Missing the required parameter 'filesize' when calling handleUploadNotebook(Async)"); + } + + // verify the required parameter 'notebook' is set + if (notebook == null) { + throw new ApiException("Missing the required parameter 'notebook' when calling handleUploadNotebook(Async)"); + } + + + okhttp3.Call localVarCall = handleUploadNotebookCall(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, _callback); + return localVarCall; + + } + + /** + * + * Upload a notebook at the specified location and wrap it in TileDB Array + * @param namespace The namespace of the notebook (required) + * @param array name/uri of array that is url-encoded (required) + * @param filesize size of the notebook to upload in bytes (required) + * @param notebook notebook to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @return NotebookUploaded + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
+ */ + public NotebookUploaded handleUploadNotebook(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name) throws ApiException { + ApiResponse localVarResp = handleUploadNotebookWithHttpInfo(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name); + return localVarResp.getData(); + } + + /** + * + * Upload a notebook at the specified location and wrap it in TileDB Array + * @param namespace The namespace of the notebook (required) + * @param array name/uri of array that is url-encoded (required) + * @param filesize size of the notebook to upload in bytes (required) + * @param notebook notebook to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @return ApiResponse<NotebookUploaded> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse handleUploadNotebookWithHttpInfo(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name) throws ApiException { + okhttp3.Call localVarCall = handleUploadNotebookValidateBeforeCall(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Upload a notebook at the specified location and wrap it in TileDB Array + * @param namespace The namespace of the notebook (required) + * @param array name/uri of array that is url-encoded (required) + * @param filesize size of the notebook to upload in bytes (required) + * @param notebook notebook to upload (required) + * @param X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME Optional registered access credentials to use for creation (optional) + * @param name name of the TileDB array to create, if missing {array} is used (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
201 Notebook uploaded -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call handleUploadNotebookAsync(String namespace, String array, Integer filesize, File notebook, String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, String name, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = handleUploadNotebookValidateBeforeCall(namespace, array, filesize, notebook, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, name, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/api/OrganizationApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/OrganizationApi.java new file mode 100644 index 0000000..e47bc2e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/OrganizationApi.java @@ -0,0 +1,847 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.model.AccessCredentialsData; +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +import io.tiledb.cloud.rest_api.v2.model.AccessCredential; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationApi(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 addCredential + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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 + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call addCredentialCall(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, 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 = accessCredential; + + // create path and map variables + String localVarPath = "/credentials/{namespace}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addCredentialValidateBeforeCall(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling addCredential(Async)"); + } + + // verify the required parameter 'accessCredential' is set + if (accessCredential == null) { + throw new ApiException("Missing the required parameter 'accessCredential' when calling addCredential(Async)"); + } + + + okhttp3.Call localVarCall = addCredentialCall(namespace, accessCredential, provider, type, page, perPage, _callback); + return localVarCall; + + } + + /** + * + * Create a new credential for the namespace + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public void addCredential(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage) throws ApiException { + addCredentialWithHttpInfo(namespace, accessCredential, provider, type, page, perPage); + } + + /** + * + * Create a new credential for the namespace + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse addCredentialWithHttpInfo(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = addCredentialValidateBeforeCall(namespace, accessCredential, provider, type, page, perPage, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Create a new credential for the namespace + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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 + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call addCredentialAsync(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addCredentialValidateBeforeCall(namespace, accessCredential, provider, type, page, perPage, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteCredential + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call deleteCredentialCall(String namespace, String name, 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/{namespace}/{name}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "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(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCredentialValidateBeforeCall(String namespace, String name, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling deleteCredential(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteCredential(Async)"); + } + + + okhttp3.Call localVarCall = deleteCredentialCall(namespace, name, _callback); + return localVarCall; + + } + + /** + * + * Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public void deleteCredential(String namespace, String name) throws ApiException { + deleteCredentialWithHttpInfo(namespace, name); + } + + /** + * + * Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (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 + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public ApiResponse deleteCredentialWithHttpInfo(String namespace, String name) throws ApiException { + okhttp3.Call localVarCall = deleteCredentialValidateBeforeCall(namespace, name, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call deleteCredentialAsync(String namespace, String name, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCredentialValidateBeforeCall(namespace, name, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getCredential + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getCredentialCall(String namespace, String name, 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/{namespace}/{name}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "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(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCredentialValidateBeforeCall(String namespace, String name, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling getCredential(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getCredential(Async)"); + } + + + okhttp3.Call localVarCall = getCredentialCall(namespace, name, _callback); + return localVarCall; + + } + + /** + * + * Retrieve an access credential by name + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @return AccessCredential + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public AccessCredential getCredential(String namespace, String name) throws ApiException { + ApiResponse localVarResp = getCredentialWithHttpInfo(namespace, name); + return localVarResp.getData(); + } + + /** + * + * Retrieve an access credential by name + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @return ApiResponse<AccessCredential> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse getCredentialWithHttpInfo(String namespace, String name) throws ApiException { + okhttp3.Call localVarCall = getCredentialValidateBeforeCall(namespace, name, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieve an access credential by name + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getCredentialAsync(String namespace, String name, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCredentialValidateBeforeCall(namespace, name, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listCredentials + * @param namespace namespace (required) + * @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 + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call listCredentialsCall(String namespace, String provider, String type, Integer page, 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/{namespace}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCredentialsValidateBeforeCall(String namespace, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling listCredentials(Async)"); + } + + + okhttp3.Call localVarCall = listCredentialsCall(namespace, provider, type, page, perPage, _callback); + return localVarCall; + + } + + /** + * + * List the credentials available in the namespace + * @param namespace namespace (required) + * @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 AccessCredentialsData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public AccessCredentialsData listCredentials(String namespace, String provider, String type, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = listCredentialsWithHttpInfo(namespace, provider, type, page, perPage); + return localVarResp.getData(); + } + + /** + * + * List the credentials available in the namespace + * @param namespace namespace (required) + * @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<AccessCredentialsData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse listCredentialsWithHttpInfo(String namespace, String provider, String type, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = listCredentialsValidateBeforeCall(namespace, provider, type, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * List the credentials available in the namespace + * @param namespace namespace (required) + * @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 + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call listCredentialsAsync(String namespace, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCredentialsValidateBeforeCall(namespace, provider, type, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateCredential + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call updateCredentialCall(String namespace, String name, AccessCredential accessCredential, 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 = accessCredential; + + // create path and map variables + String localVarPath = "/credentials/{namespace}/{name}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "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(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCredentialValidateBeforeCall(String namespace, String name, AccessCredential accessCredential, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling updateCredential(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling updateCredential(Async)"); + } + + // verify the required parameter 'accessCredential' is set + if (accessCredential == null) { + throw new ApiException("Missing the required parameter 'accessCredential' when calling updateCredential(Async)"); + } + + + okhttp3.Call localVarCall = updateCredentialCall(namespace, name, accessCredential, _callback); + return localVarCall; + + } + + /** + * + * Update the named access credential. This will also update the information used to access arrays set to use this credential. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public void updateCredential(String namespace, String name, AccessCredential accessCredential) throws ApiException { + updateCredentialWithHttpInfo(namespace, name, accessCredential); + } + + /** + * + * Update the named access credential. This will also update the information used to access arrays set to use this credential. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (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 + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public ApiResponse updateCredentialWithHttpInfo(String namespace, String name, AccessCredential accessCredential) throws ApiException { + okhttp3.Call localVarCall = updateCredentialValidateBeforeCall(namespace, name, accessCredential, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Update the named access credential. This will also update the information used to access arrays set to use this credential. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call updateCredentialAsync(String namespace, String name, AccessCredential accessCredential, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCredentialValidateBeforeCall(namespace, name, accessCredential, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/api/QueryApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/QueryApi.java new file mode 100644 index 0000000..ebfb358 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/QueryApi.java @@ -0,0 +1,280 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +import java.io.File; +import io.tiledb.cloud.rest_api.v2.model.Query; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class QueryApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public QueryApi() { + this(Configuration.getDefaultApiClient()); + } + + public QueryApi(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 submitQuery + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param type type of query (required) + * @param contentType Content Type of input and return mime (required) + * @param query query to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param openAt open_at for array in unix epoch (optional) + * @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call submitQueryCall(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll, 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 = query; + + // create path and map variables + String localVarPath = "/arrays/{namespace}/{array}/query/submit" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "array" + "\\}", localVarApiClient.escapeString(array.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (openAt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("open_at", openAt)); + } + + if (readAll != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("read_all", readAll)); + } + + if (contentType != null) { + localVarHeaderParams.put("Content-Type", localVarApiClient.parameterToString(contentType)); + } + + if (xPayer != null) { + localVarHeaderParams.put("X-Payer", localVarApiClient.parameterToString(xPayer)); + } + + final String[] localVarAccepts = { + "application/json", "application/capnp" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", "application/capnp" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitQueryValidateBeforeCall(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling submitQuery(Async)"); + } + + // verify the required parameter 'array' is set + if (array == null) { + throw new ApiException("Missing the required parameter 'array' when calling submitQuery(Async)"); + } + + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling submitQuery(Async)"); + } + + // verify the required parameter 'contentType' is set + if (contentType == null) { + throw new ApiException("Missing the required parameter 'contentType' when calling submitQuery(Async)"); + } + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException("Missing the required parameter 'query' when calling submitQuery(Async)"); + } + + + okhttp3.Call localVarCall = submitQueryCall(namespace, array, type, contentType, query, xPayer, openAt, readAll, _callback); + return localVarCall; + + } + + /** + * + * send a query to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param type type of query (required) + * @param contentType Content Type of input and return mime (required) + * @param query query to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param openAt open_at for array in unix epoch (optional) + * @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (optional) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
+ */ + public File submitQuery(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll) throws ApiException { + ApiResponse localVarResp = submitQueryWithHttpInfo(namespace, array, type, contentType, query, xPayer, openAt, readAll); + return localVarResp.getData(); + } + + /** + * + * send a query to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param type type of query (required) + * @param contentType Content Type of input and return mime (required) + * @param query query to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param openAt open_at for array in unix epoch (optional) + * @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (optional) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse submitQueryWithHttpInfo(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll) throws ApiException { + okhttp3.Call localVarCall = submitQueryValidateBeforeCall(namespace, array, type, contentType, query, xPayer, openAt, readAll, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * send a query to run against a specified array/URI registered to a group/project + * @param namespace namespace array is in (an organization name or user's username) (required) + * @param array name/uri of array that is url-encoded (required) + * @param type type of query (required) + * @param contentType Content Type of input and return mime (required) + * @param query query to run (required) + * @param xPayer Name of organization or user who should be charged for this request (optional) + * @param openAt open_at for array in unix epoch (optional) + * @param readAll If \"true\", resubmits incomplete queries until the query has completed. Defaults to \"false\". (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 query completed and results are returned in query object * X-TILEDB-CLOUD-TASK-ID - Task ID for just completed query
204 query completed successfully with no return -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call submitQueryAsync(String namespace, String array, String type, String contentType, Query query, String xPayer, Integer openAt, String readAll, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = submitQueryValidateBeforeCall(namespace, array, type, contentType, query, xPayer, openAt, readAll, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/api/UserApi.java b/src/main/java/io/tiledb/cloud/rest_api/v2/api/UserApi.java new file mode 100644 index 0000000..7a17f23 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/api/UserApi.java @@ -0,0 +1,847 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.api; + +import io.tiledb.cloud.rest_api.v2.model.AccessCredentialsData; +import io.tiledb.cloud.rest_api.v2.ApiCallback; +import io.tiledb.cloud.rest_api.v2.ApiClient; +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.ApiResponse; +import io.tiledb.cloud.rest_api.v2.Configuration; +import io.tiledb.cloud.rest_api.v2.Pair; + +import com.google.gson.reflect.TypeToken; + + +import io.tiledb.cloud.rest_api.v2.model.AccessCredential; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(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 addCredential + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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 + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call addCredentialCall(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, 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 = accessCredential; + + // create path and map variables + String localVarPath = "/credentials/{namespace}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + 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 = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addCredentialValidateBeforeCall(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling addCredential(Async)"); + } + + // verify the required parameter 'accessCredential' is set + if (accessCredential == null) { + throw new ApiException("Missing the required parameter 'accessCredential' when calling addCredential(Async)"); + } + + + okhttp3.Call localVarCall = addCredentialCall(namespace, accessCredential, provider, type, page, perPage, _callback); + return localVarCall; + + } + + /** + * + * Create a new credential for the namespace + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public void addCredential(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage) throws ApiException { + addCredentialWithHttpInfo(namespace, accessCredential, provider, type, page, perPage); + } + + /** + * + * Create a new credential for the namespace + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse addCredentialWithHttpInfo(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = addCredentialValidateBeforeCall(namespace, accessCredential, provider, type, page, perPage, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Create a new credential for the namespace + * @param namespace namespace (required) + * @param accessCredential The new credentials to be created. (required) + * @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 + + + + + +
Status Code Description Response Headers
204 The new credential was successfully added. -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call addCredentialAsync(String namespace, AccessCredential accessCredential, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addCredentialValidateBeforeCall(namespace, accessCredential, provider, type, page, perPage, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteCredential + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call deleteCredentialCall(String namespace, String name, 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/{namespace}/{name}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "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(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCredentialValidateBeforeCall(String namespace, String name, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling deleteCredential(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling deleteCredential(Async)"); + } + + + okhttp3.Call localVarCall = deleteCredentialCall(namespace, name, _callback); + return localVarCall; + + } + + /** + * + * Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public void deleteCredential(String namespace, String name) throws ApiException { + deleteCredentialWithHttpInfo(namespace, name); + } + + /** + * + * Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (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 + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public ApiResponse deleteCredentialWithHttpInfo(String namespace, String name) throws ApiException { + okhttp3.Call localVarCall = deleteCredentialValidateBeforeCall(namespace, name, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Delete the named access credential. Any arrays still set to use this credential will use the namespace's default and may become unreachable. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
204 The credential was deleted successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call deleteCredentialAsync(String namespace, String name, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCredentialValidateBeforeCall(namespace, name, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getCredential + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getCredentialCall(String namespace, String name, 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/{namespace}/{name}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "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(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCredentialValidateBeforeCall(String namespace, String name, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling getCredential(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling getCredential(Async)"); + } + + + okhttp3.Call localVarCall = getCredentialCall(namespace, name, _callback); + return localVarCall; + + } + + /** + * + * Retrieve an access credential by name + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @return AccessCredential + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public AccessCredential getCredential(String namespace, String name) throws ApiException { + ApiResponse localVarResp = getCredentialWithHttpInfo(namespace, name); + return localVarResp.getData(); + } + + /** + * + * Retrieve an access credential by name + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @return ApiResponse<AccessCredential> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse getCredentialWithHttpInfo(String namespace, String name) throws ApiException { + okhttp3.Call localVarCall = getCredentialValidateBeforeCall(namespace, name, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieve an access credential by name + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided 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 + + + + + +
Status Code Description Response Headers
200 Credential exists and can be returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call getCredentialAsync(String namespace, String name, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCredentialValidateBeforeCall(namespace, name, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listCredentials + * @param namespace namespace (required) + * @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 + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call listCredentialsCall(String namespace, String provider, String type, Integer page, 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/{namespace}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCredentialsValidateBeforeCall(String namespace, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling listCredentials(Async)"); + } + + + okhttp3.Call localVarCall = listCredentialsCall(namespace, provider, type, page, perPage, _callback); + return localVarCall; + + } + + /** + * + * List the credentials available in the namespace + * @param namespace namespace (required) + * @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 AccessCredentialsData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public AccessCredentialsData listCredentials(String namespace, String provider, String type, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = listCredentialsWithHttpInfo(namespace, provider, type, page, perPage); + return localVarResp.getData(); + } + + /** + * + * List the credentials available in the namespace + * @param namespace namespace (required) + * @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<AccessCredentialsData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public ApiResponse listCredentialsWithHttpInfo(String namespace, String provider, String type, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = listCredentialsValidateBeforeCall(namespace, provider, type, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * List the credentials available in the namespace + * @param namespace namespace (required) + * @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 + + + + + +
Status Code Description Response Headers
200 Available credentials are returned -
502 Bad Gateway -
0 error response -
+ */ + public okhttp3.Call listCredentialsAsync(String namespace, String provider, String type, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCredentialsValidateBeforeCall(namespace, provider, type, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateCredential + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call updateCredentialCall(String namespace, String name, AccessCredential accessCredential, 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 = accessCredential; + + // create path and map variables + String localVarPath = "/credentials/{namespace}/{name}" + .replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())) + .replaceAll("\\{" + "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(); + + 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[] { "ApiKeyAuth", "BasicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCredentialValidateBeforeCall(String namespace, String name, AccessCredential accessCredential, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'namespace' is set + if (namespace == null) { + throw new ApiException("Missing the required parameter 'namespace' when calling updateCredential(Async)"); + } + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling updateCredential(Async)"); + } + + // verify the required parameter 'accessCredential' is set + if (accessCredential == null) { + throw new ApiException("Missing the required parameter 'accessCredential' when calling updateCredential(Async)"); + } + + + okhttp3.Call localVarCall = updateCredentialCall(namespace, name, accessCredential, _callback); + return localVarCall; + + } + + /** + * + * Update the named access credential. This will also update the information used to access arrays set to use this credential. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public void updateCredential(String namespace, String name, AccessCredential accessCredential) throws ApiException { + updateCredentialWithHttpInfo(namespace, name, accessCredential); + } + + /** + * + * Update the named access credential. This will also update the information used to access arrays set to use this credential. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (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 + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public ApiResponse updateCredentialWithHttpInfo(String namespace, String name, AccessCredential accessCredential) throws ApiException { + okhttp3.Call localVarCall = updateCredentialValidateBeforeCall(namespace, name, accessCredential, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * Update the named access credential. This will also update the information used to access arrays set to use this credential. + * @param namespace namespace (required) + * @param name A URL-safe version of the credential's user-provided name (required) + * @param accessCredential Changes to make to this credential (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
204 The credential was updated successfully -
502 Bad Gateway -
0 Error response -
+ */ + public okhttp3.Call updateCredentialAsync(String namespace, String name, AccessCredential accessCredential, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCredentialValidateBeforeCall(namespace, name, accessCredential, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/auth/ApiKeyAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/ApiKeyAuth.java new file mode 100644 index 0000000..b6cd2a8 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.auth; + +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +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/v2/auth/Authentication.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/Authentication.java new file mode 100644 index 0000000..ae66f68 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.auth; + +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +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/v2/auth/HttpBasicAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/HttpBasicAuth.java new file mode 100644 index 0000000..d3867ec --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.auth; + +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.Pair; + +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/v2/auth/HttpBearerAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/HttpBearerAuth.java new file mode 100644 index 0000000..7565c08 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.auth; + +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/v2/auth/OAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/OAuth.java new file mode 100644 index 0000000..a7126f1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/OAuth.java @@ -0,0 +1,42 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.auth; + +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +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/v2/auth/OAuthFlow.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/OAuthFlow.java new file mode 100644 index 0000000..24a5d51 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/OAuthFlow.java @@ -0,0 +1,25 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.auth; + +/** + * OAuth flows that are supported by this client + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +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/v2/auth/OAuthOkHttpClient.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/OAuthOkHttpClient.java new file mode 100644 index 0000000..65974e9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/OAuthOkHttpClient.java @@ -0,0 +1,68 @@ +package io.tiledb.cloud.rest_api.v2.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/v2/auth/RetryingOAuth.java b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/RetryingOAuth.java new file mode 100644 index 0000000..62587df --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/auth/RetryingOAuth.java @@ -0,0 +1,210 @@ +package io.tiledb.cloud.rest_api.v2.auth; + +import io.tiledb.cloud.rest_api.v2.ApiException; +import io.tiledb.cloud.rest_api.v2.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 (String paramName : parameters.keySet()) { + tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + } + } + } + + /** + * 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 (String headerName : headers.keySet()) { + requestBuilder.addHeader(headerName, headers.get(headerName)); + } + 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/v2/model/AWSCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AWSCredential.java new file mode 100644 index 0000000..f349da2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AWSCredential.java @@ -0,0 +1,343 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Credential information to access Amazon Web Services + */ +@ApiModel(description = "Credential information to access Amazon Web Services") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AWSCredential { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + private String secretAccessKey; + + public static final String SERIALIZED_NAME_ENDPOINT = "endpoint"; + @SerializedName(SERIALIZED_NAME_ENDPOINT) + private String endpoint; + + public AWSCredential() { + } + + public AWSCredential accessKeyId(String accessKeyId) { + + this.accessKeyId = accessKeyId; + return this; + } + + /** + * The ID of the access key + * @return accessKeyId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The ID of the access key") + + public String getAccessKeyId() { + return accessKeyId; + } + + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public AWSCredential secretAccessKey(String secretAccessKey) { + + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * The access key's secret. Never returned in responses. + * @return secretAccessKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The access key's secret. Never returned in responses.") + + public String getSecretAccessKey() { + return secretAccessKey; + } + + + public void setSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + + public AWSCredential endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * The endpoint used for this credential + * @return endpoint + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "https://example.us-west-2.amazonaws.com", value = "The endpoint used for this credential") + + public String getEndpoint() { + return endpoint; + } + + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AWSCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, awSCredential.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, endpoint, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("access_key_id"); + openapiFields.add("secret_access_key"); + openapiFields.add("endpoint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AWSCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AWSCredential.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AWSCredential is not found in the empty JSON string", AWSCredential.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("access_key_id") != null && !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").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").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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AWSCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AWSCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/AWSRole.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AWSRole.java new file mode 100644 index 0000000..14bce6a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AWSRole.java @@ -0,0 +1,343 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Role information to access Amazon Web Services + */ +@ApiModel(description = "Role information to access Amazon Web Services") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AWSRole { + public static final String SERIALIZED_NAME_ROLE_ARN = "role_arn"; + @SerializedName(SERIALIZED_NAME_ROLE_ARN) + private String roleArn; + + public static final String SERIALIZED_NAME_EXTERNAL_ID = "external_id"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_ID) + private String externalId; + + public static final String SERIALIZED_NAME_ENDPOINT = "endpoint"; + @SerializedName(SERIALIZED_NAME_ENDPOINT) + private String endpoint; + + public AWSRole() { + } + + public AWSRole roleArn(String roleArn) { + + this.roleArn = roleArn; + return this; + } + + /** + * The role arn used to access + * @return roleArn + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "arn:partition:service:region:account-id:resource-type:resource-id", value = "The role arn used to access") + + public String getRoleArn() { + return roleArn; + } + + + public void setRoleArn(String roleArn) { + this.roleArn = roleArn; + } + + + public AWSRole externalId(String externalId) { + + this.externalId = externalId; + return this; + } + + /** + * The role external id used to access + * @return externalId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "MzU0M2UwMTItMWJhYy00NWUwLThmZDItZTgwYmQ1NjE5Yjhm", value = "The role external id used to access") + + public String getExternalId() { + return externalId; + } + + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + + public AWSRole endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * The endpoint used for this role + * @return endpoint + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "https://example.us-west-2.amazonaws.com", value = "The endpoint used for this role") + + public String getEndpoint() { + return endpoint; + } + + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AWSRole putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, awSRole.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(roleArn, externalId, endpoint, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class 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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("role_arn"); + openapiFields.add("external_id"); + openapiFields.add("endpoint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AWSRole + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AWSRole.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AWSRole is not found in the empty JSON string", AWSRole.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("role_arn") != null && !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") != null && !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").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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AWSRole read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AWSRole instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/AbstractOpenApiSchema.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..e03a760 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AbstractOpenApiSchema.java @@ -0,0 +1,147 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +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/v2/model/AccessCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredential.java new file mode 100644 index 0000000..d667050 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredential.java @@ -0,0 +1,523 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * A union type which may contain a credential to access any one cloud provider. + */ +@ApiModel(description = "A union type which may contain a credential to access any one cloud provider.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AccessCredential { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + private CloudProvider provider; + + public static final String SERIALIZED_NAME_PROVIDER_DEFAULT = "provider_default"; + @SerializedName(SERIALIZED_NAME_PROVIDER_DEFAULT) + private Boolean providerDefault; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_ALLOWED_IN_TASKS = "allowed_in_tasks"; + @SerializedName(SERIALIZED_NAME_ALLOWED_IN_TASKS) + private Boolean allowedInTasks; + + public static final String SERIALIZED_NAME_CREDENTIAL = "credential"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL) + private AccessCredentialCredential credential; + + public static final String SERIALIZED_NAME_ROLE = "role"; + @SerializedName(SERIALIZED_NAME_ROLE) + private AccessCredentialRole role; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private AccessCredentialToken token; + + public AccessCredential() { + } + + + public AccessCredential( + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public AccessCredential name(String name) { + + this.name = name; + return this; + } + + /** + * A user-specified name for the key + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A user-specified name for the key") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public AccessCredential provider(CloudProvider provider) { + + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public CloudProvider getProvider() { + return provider; + } + + + public void setProvider(CloudProvider provider) { + this.provider = provider; + } + + + public AccessCredential providerDefault(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 + @ApiModelProperty(value = "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.") + + public Boolean getProviderDefault() { + return providerDefault; + } + + + public void setProviderDefault(Boolean providerDefault) { + this.providerDefault = providerDefault; + } + + + /** + * Time when the credential was created (rfc3339) + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Time when the credential was created (rfc3339)") + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + + + /** + * Time when the credential was last updated (rfc3339) + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Time when the credential was last updated (rfc3339)") + + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + + public AccessCredential allowedInTasks(Boolean allowedInTasks) { + + this.allowedInTasks = allowedInTasks; + return this; + } + + /** + * Is this credential allowed to be used in tasks + * @return allowedInTasks + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Is this credential allowed to be used in tasks") + + public Boolean getAllowedInTasks() { + return allowedInTasks; + } + + + public void setAllowedInTasks(Boolean allowedInTasks) { + this.allowedInTasks = allowedInTasks; + } + + + public AccessCredential credential(AccessCredentialCredential credential) { + + this.credential = credential; + return this; + } + + /** + * Get credential + * @return credential + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AccessCredentialCredential getCredential() { + return credential; + } + + + public void setCredential(AccessCredentialCredential credential) { + this.credential = credential; + } + + + public AccessCredential role(AccessCredentialRole role) { + + this.role = role; + return this; + } + + /** + * Get role + * @return role + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AccessCredentialRole getRole() { + return role; + } + + + public void setRole(AccessCredentialRole role) { + this.role = role; + } + + + public AccessCredential token(AccessCredentialToken token) { + + this.token = token; + return this; + } + + /** + * Get token + * @return token + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AccessCredentialToken getToken() { + return token; + } + + + public void setToken(AccessCredentialToken token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AccessCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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.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)&& + Objects.equals(this.additionalProperties, accessCredential.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, provider, providerDefault, createdAt, updatedAt, allowedInTasks, credential, role, token, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredential {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("provider"); + openapiFields.add("provider_default"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("allowed_in_tasks"); + openapiFields.add("credential"); + openapiFields.add("role"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccessCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccessCredential.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredential is not found in the empty JSON string", AccessCredential.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("name") != null && !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 `credential` + if (jsonObj.getAsJsonObject("credential") != null) { + AccessCredentialCredential.validateJsonObject(jsonObj.getAsJsonObject("credential")); + } + // validate the optional field `role` + if (jsonObj.getAsJsonObject("role") != null) { + AccessCredentialRole.validateJsonObject(jsonObj.getAsJsonObject("role")); + } + // validate the optional field `token` + if (jsonObj.getAsJsonObject("token") != null) { + AccessCredentialToken.validateJsonObject(jsonObj.getAsJsonObject("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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AccessCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/AccessCredentialCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialCredential.java new file mode 100644 index 0000000..fed2453 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialCredential.java @@ -0,0 +1,347 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The credential information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum. + */ +@ApiModel(description = "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", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AccessCredentialCredential { + public static final String SERIALIZED_NAME_AWS = "aws"; + @SerializedName(SERIALIZED_NAME_AWS) + private AWSCredential aws; + + public static final String SERIALIZED_NAME_AZURE = "azure"; + @SerializedName(SERIALIZED_NAME_AZURE) + private AzureCredential azure; + + public static final String SERIALIZED_NAME_GCP = "gcp"; + @SerializedName(SERIALIZED_NAME_GCP) + private GCPInteroperabilityCredential gcp; + + public AccessCredentialCredential() { + } + + public AccessCredentialCredential aws(AWSCredential aws) { + + this.aws = aws; + return this; + } + + /** + * Get aws + * @return aws + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AWSCredential getAws() { + return aws; + } + + + public void setAws(AWSCredential aws) { + this.aws = aws; + } + + + public AccessCredentialCredential azure(AzureCredential azure) { + + this.azure = azure; + return this; + } + + /** + * Get azure + * @return azure + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AzureCredential getAzure() { + return azure; + } + + + public void setAzure(AzureCredential azure) { + this.azure = azure; + } + + + public AccessCredentialCredential gcp(GCPInteroperabilityCredential gcp) { + + this.gcp = gcp; + return this; + } + + /** + * Get gcp + * @return gcp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GCPInteroperabilityCredential getGcp() { + return gcp; + } + + + public void setGcp(GCPInteroperabilityCredential gcp) { + this.gcp = gcp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AccessCredentialCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessCredentialCredential accessCredentialCredential = (AccessCredentialCredential) o; + return Objects.equals(this.aws, accessCredentialCredential.aws) && + Objects.equals(this.azure, accessCredentialCredential.azure) && + Objects.equals(this.gcp, accessCredentialCredential.gcp)&& + Objects.equals(this.additionalProperties, accessCredentialCredential.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(aws, azure, gcp, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredentialCredential {\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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("aws"); + openapiFields.add("azure"); + openapiFields.add("gcp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccessCredentialCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccessCredentialCredential.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredentialCredential is not found in the empty JSON string", AccessCredentialCredential.openapiRequiredFields.toString())); + } + } + // validate the optional field `aws` + if (jsonObj.getAsJsonObject("aws") != null) { + AWSCredential.validateJsonObject(jsonObj.getAsJsonObject("aws")); + } + // validate the optional field `azure` + if (jsonObj.getAsJsonObject("azure") != null) { + AzureCredential.validateJsonObject(jsonObj.getAsJsonObject("azure")); + } + // validate the optional field `gcp` + if (jsonObj.getAsJsonObject("gcp") != null) { + GCPInteroperabilityCredential.validateJsonObject(jsonObj.getAsJsonObject("gcp")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessCredentialCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessCredentialCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessCredentialCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessCredentialCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessCredentialCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AccessCredentialCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessCredentialCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessCredentialCredential + * @throws IOException if the JSON string is invalid with respect to AccessCredentialCredential + */ + public static AccessCredentialCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessCredentialCredential.class); + } + + /** + * Convert an instance of AccessCredentialCredential 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/v2/model/AccessCredentialRole.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialRole.java new file mode 100644 index 0000000..a0c12de --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialRole.java @@ -0,0 +1,279 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The role information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum. + */ +@ApiModel(description = "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", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AccessCredentialRole { + public static final String SERIALIZED_NAME_AWS = "aws"; + @SerializedName(SERIALIZED_NAME_AWS) + private AWSRole aws; + + public AccessCredentialRole() { + } + + public AccessCredentialRole aws(AWSRole aws) { + + this.aws = aws; + return this; + } + + /** + * Get aws + * @return aws + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AWSRole getAws() { + return aws; + } + + + public void setAws(AWSRole aws) { + this.aws = aws; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AccessCredentialRole putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, accessCredentialRole.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(aws, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredentialRole {\n"); + sb.append(" aws: ").append(toIndentedString(aws)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("aws"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccessCredentialRole + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccessCredentialRole.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredentialRole is not found in the empty JSON string", AccessCredentialRole.openapiRequiredFields.toString())); + } + } + // validate the optional field `aws` + if (jsonObj.getAsJsonObject("aws") != null) { + AWSRole.validateJsonObject(jsonObj.getAsJsonObject("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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessCredentialRole read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AccessCredentialRole instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/AccessCredentialToken.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialToken.java new file mode 100644 index 0000000..fe38393 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialToken.java @@ -0,0 +1,313 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The token information itself. Exactly one sub-field may be set. The names match those in the CloudProvider enum. + */ +@ApiModel(description = "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", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AccessCredentialToken { + public static final String SERIALIZED_NAME_AZURE = "azure"; + @SerializedName(SERIALIZED_NAME_AZURE) + private AzureToken azure; + + public static final String SERIALIZED_NAME_GCP = "gcp"; + @SerializedName(SERIALIZED_NAME_GCP) + private GCPServiceAccountKey gcp; + + public AccessCredentialToken() { + } + + public AccessCredentialToken azure(AzureToken azure) { + + this.azure = azure; + return this; + } + + /** + * Get azure + * @return azure + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AzureToken getAzure() { + return azure; + } + + + public void setAzure(AzureToken azure) { + this.azure = azure; + } + + + public AccessCredentialToken gcp(GCPServiceAccountKey gcp) { + + this.gcp = gcp; + return this; + } + + /** + * Get gcp + * @return gcp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GCPServiceAccountKey getGcp() { + return gcp; + } + + + public void setGcp(GCPServiceAccountKey gcp) { + this.gcp = gcp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AccessCredentialToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessCredentialToken accessCredentialToken = (AccessCredentialToken) o; + return Objects.equals(this.azure, accessCredentialToken.azure) && + Objects.equals(this.gcp, accessCredentialToken.gcp)&& + Objects.equals(this.additionalProperties, accessCredentialToken.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(azure, gcp, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredentialToken {\n"); + sb.append(" azure: ").append(toIndentedString(azure)).append("\n"); + sb.append(" gcp: ").append(toIndentedString(gcp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("azure"); + openapiFields.add("gcp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccessCredentialToken + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccessCredentialToken.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredentialToken is not found in the empty JSON string", AccessCredentialToken.openapiRequiredFields.toString())); + } + } + // validate the optional field `azure` + if (jsonObj.getAsJsonObject("azure") != null) { + AzureToken.validateJsonObject(jsonObj.getAsJsonObject("azure")); + } + // validate the optional field `gcp` + if (jsonObj.getAsJsonObject("gcp") != null) { + GCPServiceAccountKey.validateJsonObject(jsonObj.getAsJsonObject("gcp")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessCredentialToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessCredentialToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessCredentialToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessCredentialToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessCredentialToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AccessCredentialToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessCredentialToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessCredentialToken + * @throws IOException if the JSON string is invalid with respect to AccessCredentialToken + */ + public static AccessCredentialToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessCredentialToken.class); + } + + /** + * Convert an instance of AccessCredentialToken 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/v2/model/AccessCredentialType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialType.java new file mode 100644 index 0000000..8dabc6c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialType.java @@ -0,0 +1,71 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The types of an access credential + */ +@JsonAdapter(AccessCredentialType.Adapter.class) +public enum AccessCredentialType { + + KEY("key"), + + ARN("arn"), + + AZURE_TOKEN("azure_token"); + + private String value; + + AccessCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccessCredentialType fromValue(String value) { + for (AccessCredentialType b : AccessCredentialType.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 AccessCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccessCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccessCredentialType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialsData.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialsData.java new file mode 100644 index 0000000..58d7755 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AccessCredentialsData.java @@ -0,0 +1,319 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Object including credentials and pagination metadata + */ +@ApiModel(description = "Object including credentials and pagination metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AccessCredentialsData { + public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS) + private List credentials = null; + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + private PaginationMetadata paginationMetadata; + + public AccessCredentialsData() { + } + + public AccessCredentialsData credentials(List credentials) { + + this.credentials = credentials; + return this; + } + + public AccessCredentialsData addCredentialsItem(AccessCredential credentialsItem) { + if (this.credentials == null) { + this.credentials = new ArrayList<>(); + } + this.credentials.add(credentialsItem); + return this; + } + + /** + * List of credentials + * @return credentials + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of credentials") + + public List getCredentials() { + return credentials; + } + + + public void setCredentials(List credentials) { + this.credentials = credentials; + } + + + public AccessCredentialsData paginationMetadata(PaginationMetadata paginationMetadata) { + + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + + public void setPaginationMetadata(PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AccessCredentialsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessCredentialsData accessCredentialsData = (AccessCredentialsData) o; + return Objects.equals(this.credentials, accessCredentialsData.credentials) && + Objects.equals(this.paginationMetadata, accessCredentialsData.paginationMetadata)&& + Objects.equals(this.additionalProperties, accessCredentialsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credentials, paginationMetadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessCredentialsData {\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("credentials"); + openapiFields.add("pagination_metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccessCredentialsData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccessCredentialsData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessCredentialsData is not found in the empty JSON string", AccessCredentialsData.openapiRequiredFields.toString())); + } + } + JsonArray jsonArraycredentials = jsonObj.getAsJsonArray("credentials"); + if (jsonArraycredentials != null) { + // ensure the json data is an array + if (!jsonObj.get("credentials").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `credentials` to be an array in the JSON string but got `%s`", jsonObj.get("credentials").toString())); + } + + // validate the optional field `credentials` (array) + for (int i = 0; i < jsonArraycredentials.size(); i++) { + AccessCredential.validateJsonObject(jsonArraycredentials.get(i).getAsJsonObject()); + }; + } + // validate the optional field `pagination_metadata` + if (jsonObj.getAsJsonObject("pagination_metadata") != null) { + PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessCredentialsData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessCredentialsData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessCredentialsData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessCredentialsData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessCredentialsData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AccessCredentialsData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessCredentialsData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessCredentialsData + * @throws IOException if the JSON string is invalid with respect to AccessCredentialsData + */ + public static AccessCredentialsData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessCredentialsData.class); + } + + /** + * Convert an instance of AccessCredentialsData 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/v2/model/ActivityEventType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ActivityEventType.java new file mode 100644 index 0000000..845b191 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ActivityEventType.java @@ -0,0 +1,97 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Type of activity logged + */ +@JsonAdapter(ActivityEventType.Adapter.class) +public enum ActivityEventType { + + READ_SCHEMA("read_schema"), + + MAX_BUFFER_SIZES("max_buffer_sizes"), + + NON_EMPTY_DOMAIN("non_empty_domain"), + + QUERY_READ("query_read"), + + QUERY_WRITE("query_write"), + + CREATE("create"), + + DELETE("delete"), + + REGISTER("register"), + + DEREGISTER("deregister"), + + UDF("udf"), + + ARRAY_METADATA_GET("array_metadata_get"), + + ARRAY_METADATA_UPDATE("array_metadata_update"), + + ESTIMATED_RESULT_SIZES("estimated_result_sizes"), + + UPDATE("update"), + + INFO("info"), + + RUN("run"); + + private String value; + + ActivityEventType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActivityEventType fromValue(String value) { + for (ActivityEventType b : ActivityEventType.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 ActivityEventType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActivityEventType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActivityEventType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/Array.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Array.java new file mode 100644 index 0000000..c58b074 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Array.java @@ -0,0 +1,618 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Represents an open array + */ +@ApiModel(description = "Represents an open array") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Array { + public static final String SERIALIZED_NAME_QUERY_TYPE = "queryType"; + @SerializedName(SERIALIZED_NAME_QUERY_TYPE) + private Querytype queryType; + + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_END_TIMESTAMP = "endTimestamp"; + @SerializedName(SERIALIZED_NAME_END_TIMESTAMP) + private BigDecimal endTimestamp; + + public static final String SERIALIZED_NAME_START_TIMESTAMP = "startTimestamp"; + @SerializedName(SERIALIZED_NAME_START_TIMESTAMP) + private BigDecimal startTimestamp; + + public static final String SERIALIZED_NAME_ARRAY_SCHEMA_LATEST = "arraySchemaLatest"; + @SerializedName(SERIALIZED_NAME_ARRAY_SCHEMA_LATEST) + private ArraySchema arraySchemaLatest; + + public static final String SERIALIZED_NAME_ARRAY_SCHEMAS_ALL = "arraySchemasAll"; + @SerializedName(SERIALIZED_NAME_ARRAY_SCHEMAS_ALL) + private ArraySchemaMap arraySchemasAll; + + public static final String SERIALIZED_NAME_ARRAY_METADATA = "arrayMetadata"; + @SerializedName(SERIALIZED_NAME_ARRAY_METADATA) + private ArrayMetadata arrayMetadata; + + public static final String SERIALIZED_NAME_NON_EMPTY_DOMAIN = "nonEmptyDomain"; + @SerializedName(SERIALIZED_NAME_NON_EMPTY_DOMAIN) + private NonEmptyDomainList nonEmptyDomain; + + public static final String SERIALIZED_NAME_ARRAY_DIRECTORY = "arrayDirectory"; + @SerializedName(SERIALIZED_NAME_ARRAY_DIRECTORY) + private ArrayDirectory arrayDirectory; + + public static final String SERIALIZED_NAME_FRAGMENT_METADATA_ALL = "fragmentMetadataAll"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_METADATA_ALL) + private List fragmentMetadataAll = null; + + public static final String SERIALIZED_NAME_OPENED_AT_END_TIMESTAMP = "openedAtEndTimestamp"; + @SerializedName(SERIALIZED_NAME_OPENED_AT_END_TIMESTAMP) + private BigDecimal openedAtEndTimestamp; + + public Array() { + } + + public Array queryType(Querytype queryType) { + + this.queryType = queryType; + return this; + } + + /** + * Get queryType + * @return queryType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Querytype getQueryType() { + return queryType; + } + + + public void setQueryType(Querytype queryType) { + this.queryType = queryType; + } + + + public Array uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * Array uri + * @return uri + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Array uri") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public Array endTimestamp(BigDecimal endTimestamp) { + + this.endTimestamp = endTimestamp; + return this; + } + + /** + * Ending timestamp (epoch milliseconds) array is opened at + * @return endTimestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1540471791873", value = "Ending timestamp (epoch milliseconds) array is opened at") + + public BigDecimal getEndTimestamp() { + return endTimestamp; + } + + + public void setEndTimestamp(BigDecimal endTimestamp) { + this.endTimestamp = endTimestamp; + } + + + public Array startTimestamp(BigDecimal startTimestamp) { + + this.startTimestamp = startTimestamp; + return this; + } + + /** + * Starting timestamp (epoch milliseconds) array is opened at + * @return startTimestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1540471791873", value = "Starting timestamp (epoch milliseconds) array is opened at") + + public BigDecimal getStartTimestamp() { + return startTimestamp; + } + + + public void setStartTimestamp(BigDecimal startTimestamp) { + this.startTimestamp = startTimestamp; + } + + + public Array arraySchemaLatest(ArraySchema arraySchemaLatest) { + + this.arraySchemaLatest = arraySchemaLatest; + return this; + } + + /** + * Get arraySchemaLatest + * @return arraySchemaLatest + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArraySchema getArraySchemaLatest() { + return arraySchemaLatest; + } + + + public void setArraySchemaLatest(ArraySchema arraySchemaLatest) { + this.arraySchemaLatest = arraySchemaLatest; + } + + + public Array arraySchemasAll(ArraySchemaMap arraySchemasAll) { + + this.arraySchemasAll = arraySchemasAll; + return this; + } + + /** + * Get arraySchemasAll + * @return arraySchemasAll + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArraySchemaMap getArraySchemasAll() { + return arraySchemasAll; + } + + + public void setArraySchemasAll(ArraySchemaMap arraySchemasAll) { + this.arraySchemasAll = arraySchemasAll; + } + + + public Array arrayMetadata(ArrayMetadata arrayMetadata) { + + this.arrayMetadata = arrayMetadata; + return this; + } + + /** + * Get arrayMetadata + * @return arrayMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArrayMetadata getArrayMetadata() { + return arrayMetadata; + } + + + public void setArrayMetadata(ArrayMetadata arrayMetadata) { + this.arrayMetadata = arrayMetadata; + } + + + public Array nonEmptyDomain(NonEmptyDomainList nonEmptyDomain) { + + this.nonEmptyDomain = nonEmptyDomain; + return this; + } + + /** + * Get nonEmptyDomain + * @return nonEmptyDomain + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public NonEmptyDomainList getNonEmptyDomain() { + return nonEmptyDomain; + } + + + public void setNonEmptyDomain(NonEmptyDomainList nonEmptyDomain) { + this.nonEmptyDomain = nonEmptyDomain; + } + + + public Array arrayDirectory(ArrayDirectory arrayDirectory) { + + this.arrayDirectory = arrayDirectory; + return this; + } + + /** + * Get arrayDirectory + * @return arrayDirectory + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArrayDirectory getArrayDirectory() { + return arrayDirectory; + } + + + public void setArrayDirectory(ArrayDirectory arrayDirectory) { + this.arrayDirectory = arrayDirectory; + } + + + public Array fragmentMetadataAll(List fragmentMetadataAll) { + + this.fragmentMetadataAll = fragmentMetadataAll; + return this; + } + + public Array addFragmentMetadataAllItem(FragmentMetadata fragmentMetadataAllItem) { + if (this.fragmentMetadataAll == null) { + this.fragmentMetadataAll = new ArrayList<>(); + } + this.fragmentMetadataAll.add(fragmentMetadataAllItem); + return this; + } + + /** + * metadata for all fragments (for reads) + * @return fragmentMetadataAll + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "metadata for all fragments (for reads)") + + public List getFragmentMetadataAll() { + return fragmentMetadataAll; + } + + + public void setFragmentMetadataAll(List fragmentMetadataAll) { + this.fragmentMetadataAll = fragmentMetadataAll; + } + + + public Array openedAtEndTimestamp(BigDecimal openedAtEndTimestamp) { + + this.openedAtEndTimestamp = openedAtEndTimestamp; + return this; + } + + /** + * The ending timestamp that the array was last opened at + * @return openedAtEndTimestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The ending timestamp that the array was last opened at") + + public BigDecimal getOpenedAtEndTimestamp() { + return openedAtEndTimestamp; + } + + + public void setOpenedAtEndTimestamp(BigDecimal openedAtEndTimestamp) { + this.openedAtEndTimestamp = openedAtEndTimestamp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Array putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Array array = (Array) o; + return Objects.equals(this.queryType, array.queryType) && + Objects.equals(this.uri, array.uri) && + Objects.equals(this.endTimestamp, array.endTimestamp) && + Objects.equals(this.startTimestamp, array.startTimestamp) && + Objects.equals(this.arraySchemaLatest, array.arraySchemaLatest) && + Objects.equals(this.arraySchemasAll, array.arraySchemasAll) && + Objects.equals(this.arrayMetadata, array.arrayMetadata) && + Objects.equals(this.nonEmptyDomain, array.nonEmptyDomain) && + Objects.equals(this.arrayDirectory, array.arrayDirectory) && + Objects.equals(this.fragmentMetadataAll, array.fragmentMetadataAll) && + Objects.equals(this.openedAtEndTimestamp, array.openedAtEndTimestamp)&& + Objects.equals(this.additionalProperties, array.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(queryType, uri, endTimestamp, startTimestamp, arraySchemaLatest, arraySchemasAll, arrayMetadata, nonEmptyDomain, arrayDirectory, fragmentMetadataAll, openedAtEndTimestamp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Array {\n"); + sb.append(" queryType: ").append(toIndentedString(queryType)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" endTimestamp: ").append(toIndentedString(endTimestamp)).append("\n"); + sb.append(" startTimestamp: ").append(toIndentedString(startTimestamp)).append("\n"); + sb.append(" arraySchemaLatest: ").append(toIndentedString(arraySchemaLatest)).append("\n"); + sb.append(" arraySchemasAll: ").append(toIndentedString(arraySchemasAll)).append("\n"); + sb.append(" arrayMetadata: ").append(toIndentedString(arrayMetadata)).append("\n"); + sb.append(" nonEmptyDomain: ").append(toIndentedString(nonEmptyDomain)).append("\n"); + sb.append(" arrayDirectory: ").append(toIndentedString(arrayDirectory)).append("\n"); + sb.append(" fragmentMetadataAll: ").append(toIndentedString(fragmentMetadataAll)).append("\n"); + sb.append(" openedAtEndTimestamp: ").append(toIndentedString(openedAtEndTimestamp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("queryType"); + openapiFields.add("uri"); + openapiFields.add("endTimestamp"); + openapiFields.add("startTimestamp"); + openapiFields.add("arraySchemaLatest"); + openapiFields.add("arraySchemasAll"); + openapiFields.add("arrayMetadata"); + openapiFields.add("nonEmptyDomain"); + openapiFields.add("arrayDirectory"); + openapiFields.add("fragmentMetadataAll"); + openapiFields.add("openedAtEndTimestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("queryType"); + openapiRequiredFields.add("uri"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Array + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Array.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Array is not found in the empty JSON string", Array.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Array.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("uri") != null && !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())); + } + // validate the optional field `arraySchemaLatest` + if (jsonObj.getAsJsonObject("arraySchemaLatest") != null) { + ArraySchema.validateJsonObject(jsonObj.getAsJsonObject("arraySchemaLatest")); + } + // validate the optional field `arraySchemasAll` + if (jsonObj.getAsJsonObject("arraySchemasAll") != null) { + ArraySchemaMap.validateJsonObject(jsonObj.getAsJsonObject("arraySchemasAll")); + } + // validate the optional field `arrayMetadata` + if (jsonObj.getAsJsonObject("arrayMetadata") != null) { + ArrayMetadata.validateJsonObject(jsonObj.getAsJsonObject("arrayMetadata")); + } + // validate the optional field `nonEmptyDomain` + if (jsonObj.getAsJsonObject("nonEmptyDomain") != null) { + NonEmptyDomainList.validateJsonObject(jsonObj.getAsJsonObject("nonEmptyDomain")); + } + // validate the optional field `arrayDirectory` + if (jsonObj.getAsJsonObject("arrayDirectory") != null) { + ArrayDirectory.validateJsonObject(jsonObj.getAsJsonObject("arrayDirectory")); + } + JsonArray jsonArrayfragmentMetadataAll = jsonObj.getAsJsonArray("fragmentMetadataAll"); + if (jsonArrayfragmentMetadataAll != null) { + // ensure the json data is an array + if (!jsonObj.get("fragmentMetadataAll").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentMetadataAll` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentMetadataAll").toString())); + } + + // validate the optional field `fragmentMetadataAll` (array) + for (int i = 0; i < jsonArrayfragmentMetadataAll.size(); i++) { + FragmentMetadata.validateJsonObject(jsonArrayfragmentMetadataAll.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Array.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Array' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Array.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Array value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Array read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Array instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Array given an JSON string + * + * @param jsonString JSON string + * @return An instance of Array + * @throws IOException if the JSON string is invalid with respect to Array + */ + public static Array fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Array.class); + } + + /** + * Convert an instance of Array 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/v2/model/ArrayActivityLog.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayActivityLog.java new file mode 100644 index 0000000..975f72f --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayActivityLog.java @@ -0,0 +1,518 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Activity of an Array + */ +@ApiModel(description = "Activity of an Array") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArrayActivityLog { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private ActivityEventType action; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_BYTES_SENT = "bytes_sent"; + @SerializedName(SERIALIZED_NAME_BYTES_SENT) + private Integer bytesSent; + + public static final String SERIALIZED_NAME_BYTES_RECEIVED = "bytes_received"; + @SerializedName(SERIALIZED_NAME_BYTES_RECEIVED) + private Integer bytesReceived; + + public static final String SERIALIZED_NAME_ARRAY_TASK_ID = "array_task_id"; + @SerializedName(SERIALIZED_NAME_ARRAY_TASK_ID) + private String arrayTaskId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_QUERY_RANGES = "query_ranges"; + @SerializedName(SERIALIZED_NAME_QUERY_RANGES) + private String queryRanges; + + public static final String SERIALIZED_NAME_QUERY_STATS = "query_stats"; + @SerializedName(SERIALIZED_NAME_QUERY_STATS) + private String queryStats; + + public ArrayActivityLog() { + } + + public ArrayActivityLog eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * time event took place (RFC3339) + * @return eventAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "time event took place (RFC3339)") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public ArrayActivityLog action(ActivityEventType action) { + + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ActivityEventType getAction() { + return action; + } + + + public void setAction(ActivityEventType action) { + this.action = action; + } + + + public ArrayActivityLog username(String username) { + + this.username = username; + return this; + } + + /** + * User who performed action + * @return username + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "user1", value = "User who performed action") + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public ArrayActivityLog bytesSent(Integer bytesSent) { + + this.bytesSent = bytesSent; + return this; + } + + /** + * Bytes sent to client + * @return bytesSent + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1073741824", value = "Bytes sent to client") + + public Integer getBytesSent() { + return bytesSent; + } + + + public void setBytesSent(Integer bytesSent) { + this.bytesSent = bytesSent; + } + + + public ArrayActivityLog bytesReceived(Integer bytesReceived) { + + this.bytesReceived = bytesReceived; + return this; + } + + /** + * Bytes recieved from client + * @return bytesReceived + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1073741824", value = "Bytes recieved from client") + + public Integer getBytesReceived() { + return bytesReceived; + } + + + public void setBytesReceived(Integer bytesReceived) { + this.bytesReceived = bytesReceived; + } + + + public ArrayActivityLog arrayTaskId(String arrayTaskId) { + + this.arrayTaskId = arrayTaskId; + return this; + } + + /** + * uuid of associated array task + * @return arrayTaskId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "uuid of associated array task") + + public String getArrayTaskId() { + return arrayTaskId; + } + + + public void setArrayTaskId(String arrayTaskId) { + this.arrayTaskId = arrayTaskId; + } + + + public ArrayActivityLog id(String id) { + + this.id = id; + return this; + } + + /** + * id of the activity + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "id of the activity") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public ArrayActivityLog queryRanges(String queryRanges) { + + this.queryRanges = queryRanges; + return this; + } + + /** + * ranges for query + * @return queryRanges + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "{\"rows\":[{\"start\": 1, \"end\": 1},{\"start\": 3, \"end\": 4}],\"cols\":[{\"start\": 1, \"end\": 4}]}", value = "ranges for query") + + public String getQueryRanges() { + return queryRanges; + } + + + public void setQueryRanges(String queryRanges) { + this.queryRanges = queryRanges; + } + + + public ArrayActivityLog queryStats(String queryStats) { + + this.queryStats = queryStats; + return this; + } + + /** + * stats for query + * @return queryStats + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "{\"timers\": {\"Context.StorageManager.read_load_array_schema_from_uri.sum\": 0.0255293, \"...\": \"...\"}, \"counters\": {\"Context.StorageManager.read_unfiltered_byte_num\": 191, \"...\": \"...\"}}", value = "stats for query") + + public String getQueryStats() { + return queryStats; + } + + + public void setQueryStats(String queryStats) { + this.queryStats = queryStats; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayActivityLog putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayActivityLog arrayActivityLog = (ArrayActivityLog) o; + return Objects.equals(this.eventAt, arrayActivityLog.eventAt) && + Objects.equals(this.action, arrayActivityLog.action) && + Objects.equals(this.username, arrayActivityLog.username) && + Objects.equals(this.bytesSent, arrayActivityLog.bytesSent) && + Objects.equals(this.bytesReceived, arrayActivityLog.bytesReceived) && + Objects.equals(this.arrayTaskId, arrayActivityLog.arrayTaskId) && + Objects.equals(this.id, arrayActivityLog.id) && + Objects.equals(this.queryRanges, arrayActivityLog.queryRanges) && + Objects.equals(this.queryStats, arrayActivityLog.queryStats)&& + Objects.equals(this.additionalProperties, arrayActivityLog.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, action, username, bytesSent, bytesReceived, arrayTaskId, id, queryRanges, queryStats, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayActivityLog {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" bytesSent: ").append(toIndentedString(bytesSent)).append("\n"); + sb.append(" bytesReceived: ").append(toIndentedString(bytesReceived)).append("\n"); + sb.append(" arrayTaskId: ").append(toIndentedString(arrayTaskId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" queryRanges: ").append(toIndentedString(queryRanges)).append("\n"); + sb.append(" queryStats: ").append(toIndentedString(queryStats)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("action"); + openapiFields.add("username"); + openapiFields.add("bytes_sent"); + openapiFields.add("bytes_received"); + openapiFields.add("array_task_id"); + openapiFields.add("id"); + openapiFields.add("query_ranges"); + openapiFields.add("query_stats"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayActivityLog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayActivityLog.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayActivityLog is not found in the empty JSON string", ArrayActivityLog.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("username") != null && !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("array_task_id") != null && !jsonObj.get("array_task_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `array_task_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("array_task_id").toString())); + } + if (jsonObj.get("id") != null && !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("query_ranges") != null && !jsonObj.get("query_ranges").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `query_ranges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query_ranges").toString())); + } + if (jsonObj.get("query_stats") != null && !jsonObj.get("query_stats").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `query_stats` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query_stats").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayActivityLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayActivityLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayActivityLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayActivityLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayActivityLog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayActivityLog instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayActivityLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayActivityLog + * @throws IOException if the JSON string is invalid with respect to ArrayActivityLog + */ + public static ArrayActivityLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayActivityLog.class); + } + + /** + * Convert an instance of ArrayActivityLog 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/v2/model/ArrayActivityLogData.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayActivityLogData.java new file mode 100644 index 0000000..099ce9b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayActivityLogData.java @@ -0,0 +1,319 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Object including array tasks and metadata + */ +@ApiModel(description = "Object including array tasks and metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArrayActivityLogData { + public static final String SERIALIZED_NAME_ACTIVITYLOGS = "activitylogs"; + @SerializedName(SERIALIZED_NAME_ACTIVITYLOGS) + private List activitylogs = null; + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + private PaginationMetadata paginationMetadata; + + public ArrayActivityLogData() { + } + + public ArrayActivityLogData activitylogs(List activitylogs) { + + this.activitylogs = activitylogs; + return this; + } + + public ArrayActivityLogData addActivitylogsItem(ArrayActivityLog activitylogsItem) { + if (this.activitylogs == null) { + this.activitylogs = new ArrayList<>(); + } + this.activitylogs.add(activitylogsItem); + return this; + } + + /** + * Array ArrayActivityLog + * @return activitylogs + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Array ArrayActivityLog") + + public List getActivitylogs() { + return activitylogs; + } + + + public void setActivitylogs(List activitylogs) { + this.activitylogs = activitylogs; + } + + + public ArrayActivityLogData paginationMetadata(PaginationMetadata paginationMetadata) { + + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + + public void setPaginationMetadata(PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayActivityLogData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayActivityLogData arrayActivityLogData = (ArrayActivityLogData) o; + return Objects.equals(this.activitylogs, arrayActivityLogData.activitylogs) && + Objects.equals(this.paginationMetadata, arrayActivityLogData.paginationMetadata)&& + Objects.equals(this.additionalProperties, arrayActivityLogData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(activitylogs, paginationMetadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayActivityLogData {\n"); + sb.append(" activitylogs: ").append(toIndentedString(activitylogs)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activitylogs"); + openapiFields.add("pagination_metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayActivityLogData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayActivityLogData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayActivityLogData is not found in the empty JSON string", ArrayActivityLogData.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayactivitylogs = jsonObj.getAsJsonArray("activitylogs"); + if (jsonArrayactivitylogs != null) { + // ensure the json data is an array + if (!jsonObj.get("activitylogs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `activitylogs` to be an array in the JSON string but got `%s`", jsonObj.get("activitylogs").toString())); + } + + // validate the optional field `activitylogs` (array) + for (int i = 0; i < jsonArrayactivitylogs.size(); i++) { + ArrayActivityLog.validateJsonObject(jsonArrayactivitylogs.get(i).getAsJsonObject()); + }; + } + // validate the optional field `pagination_metadata` + if (jsonObj.getAsJsonObject("pagination_metadata") != null) { + PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayActivityLogData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayActivityLogData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayActivityLogData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayActivityLogData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayActivityLogData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayActivityLogData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayActivityLogData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayActivityLogData + * @throws IOException if the JSON string is invalid with respect to ArrayActivityLogData + */ + public static ArrayActivityLogData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayActivityLogData.class); + } + + /** + * Convert an instance of ArrayActivityLogData 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/v2/model/ArrayDirectory.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayDirectory.java new file mode 100644 index 0000000..7dac522 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayDirectory.java @@ -0,0 +1,807 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Array directory (for reads) + */ +@ApiModel(description = "Array directory (for reads)") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArrayDirectory { + public static final String SERIALIZED_NAME_UNFILTERED_FRAGMENT_URIS = "unfilteredFragmentUris"; + @SerializedName(SERIALIZED_NAME_UNFILTERED_FRAGMENT_URIS) + private List unfilteredFragmentUris = null; + + public static final String SERIALIZED_NAME_CONSOLIDATED_COMMIT_URIS = "consolidatedCommitUris"; + @SerializedName(SERIALIZED_NAME_CONSOLIDATED_COMMIT_URIS) + private List consolidatedCommitUris = null; + + public static final String SERIALIZED_NAME_ARRAY_SCHEMA_URIS = "arraySchemaUris"; + @SerializedName(SERIALIZED_NAME_ARRAY_SCHEMA_URIS) + private List arraySchemaUris = null; + + public static final String SERIALIZED_NAME_LATEST_ARRAY_SCHEMA_URI = "latestArraySchemaUri"; + @SerializedName(SERIALIZED_NAME_LATEST_ARRAY_SCHEMA_URI) + private String latestArraySchemaUri; + + public static final String SERIALIZED_NAME_ARRAY_META_URIS_TO_VACUUM = "arrayMetaUrisToVacuum"; + @SerializedName(SERIALIZED_NAME_ARRAY_META_URIS_TO_VACUUM) + private List arrayMetaUrisToVacuum = null; + + public static final String SERIALIZED_NAME_ARRAY_META_VAC_URIS_TO_VACUUM = "arrayMetaVacUrisToVacuum"; + @SerializedName(SERIALIZED_NAME_ARRAY_META_VAC_URIS_TO_VACUUM) + private List arrayMetaVacUrisToVacuum = null; + + public static final String SERIALIZED_NAME_COMMIT_URIS_TO_CONSOLIDATE = "commitUrisToConsolidate"; + @SerializedName(SERIALIZED_NAME_COMMIT_URIS_TO_CONSOLIDATE) + private List commitUrisToConsolidate = null; + + public static final String SERIALIZED_NAME_COMMIT_URIS_TO_VACUUM = "commitUrisToVacuum"; + @SerializedName(SERIALIZED_NAME_COMMIT_URIS_TO_VACUUM) + private List commitUrisToVacuum = null; + + public static final String SERIALIZED_NAME_CONSOLIDATED_COMMIT_URIS_TO_VACUUM = "consolidatedCommitUrisToVacuum"; + @SerializedName(SERIALIZED_NAME_CONSOLIDATED_COMMIT_URIS_TO_VACUUM) + private List consolidatedCommitUrisToVacuum = null; + + public static final String SERIALIZED_NAME_FRAGMENT_META_URIS = "fragmentMetaUris"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_META_URIS) + private List fragmentMetaUris = null; + + public static final String SERIALIZED_NAME_TIMESTAMP_START = "timestampStart"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP_START) + private BigDecimal timestampStart; + + public static final String SERIALIZED_NAME_TIMESTAMP_END = "timestampEnd"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP_END) + private BigDecimal timestampEnd; + + public static final String SERIALIZED_NAME_ARRAY_META_URIS = "arrayMetaUris"; + @SerializedName(SERIALIZED_NAME_ARRAY_META_URIS) + private List arrayMetaUris = null; + + public static final String SERIALIZED_NAME_DELETE_AND_UPDATE_TILE_LOCATION = "deleteAndUpdateTileLocation"; + @SerializedName(SERIALIZED_NAME_DELETE_AND_UPDATE_TILE_LOCATION) + private List deleteAndUpdateTileLocation = null; + + public ArrayDirectory() { + } + + public ArrayDirectory unfilteredFragmentUris(List unfilteredFragmentUris) { + + this.unfilteredFragmentUris = unfilteredFragmentUris; + return this; + } + + public ArrayDirectory addUnfilteredFragmentUrisItem(String unfilteredFragmentUrisItem) { + if (this.unfilteredFragmentUris == null) { + this.unfilteredFragmentUris = new ArrayList<>(); + } + this.unfilteredFragmentUris.add(unfilteredFragmentUrisItem); + return this; + } + + /** + * fragment URIs + * @return unfilteredFragmentUris + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "fragment URIs") + + public List getUnfilteredFragmentUris() { + return unfilteredFragmentUris; + } + + + public void setUnfilteredFragmentUris(List unfilteredFragmentUris) { + this.unfilteredFragmentUris = unfilteredFragmentUris; + } + + + public ArrayDirectory consolidatedCommitUris(List consolidatedCommitUris) { + + this.consolidatedCommitUris = consolidatedCommitUris; + return this; + } + + public ArrayDirectory addConsolidatedCommitUrisItem(String consolidatedCommitUrisItem) { + if (this.consolidatedCommitUris == null) { + this.consolidatedCommitUris = new ArrayList<>(); + } + this.consolidatedCommitUris.add(consolidatedCommitUrisItem); + return this; + } + + /** + * consolidated commit URI set + * @return consolidatedCommitUris + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "consolidated commit URI set") + + public List getConsolidatedCommitUris() { + return consolidatedCommitUris; + } + + + public void setConsolidatedCommitUris(List consolidatedCommitUris) { + this.consolidatedCommitUris = consolidatedCommitUris; + } + + + public ArrayDirectory arraySchemaUris(List arraySchemaUris) { + + this.arraySchemaUris = arraySchemaUris; + return this; + } + + public ArrayDirectory addArraySchemaUrisItem(String arraySchemaUrisItem) { + if (this.arraySchemaUris == null) { + this.arraySchemaUris = new ArrayList<>(); + } + this.arraySchemaUris.add(arraySchemaUrisItem); + return this; + } + + /** + * URIs of all the array schema files + * @return arraySchemaUris + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "URIs of all the array schema files") + + public List getArraySchemaUris() { + return arraySchemaUris; + } + + + public void setArraySchemaUris(List arraySchemaUris) { + this.arraySchemaUris = arraySchemaUris; + } + + + public ArrayDirectory latestArraySchemaUri(String latestArraySchemaUri) { + + this.latestArraySchemaUri = latestArraySchemaUri; + return this; + } + + /** + * latest array schema URI. + * @return latestArraySchemaUri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "latest array schema URI.") + + public String getLatestArraySchemaUri() { + return latestArraySchemaUri; + } + + + public void setLatestArraySchemaUri(String latestArraySchemaUri) { + this.latestArraySchemaUri = latestArraySchemaUri; + } + + + public ArrayDirectory arrayMetaUrisToVacuum(List arrayMetaUrisToVacuum) { + + this.arrayMetaUrisToVacuum = arrayMetaUrisToVacuum; + return this; + } + + public ArrayDirectory addArrayMetaUrisToVacuumItem(String arrayMetaUrisToVacuumItem) { + if (this.arrayMetaUrisToVacuum == null) { + this.arrayMetaUrisToVacuum = new ArrayList<>(); + } + this.arrayMetaUrisToVacuum.add(arrayMetaUrisToVacuumItem); + return this; + } + + /** + * the array metadata files to vacuum + * @return arrayMetaUrisToVacuum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the array metadata files to vacuum") + + public List getArrayMetaUrisToVacuum() { + return arrayMetaUrisToVacuum; + } + + + public void setArrayMetaUrisToVacuum(List arrayMetaUrisToVacuum) { + this.arrayMetaUrisToVacuum = arrayMetaUrisToVacuum; + } + + + public ArrayDirectory arrayMetaVacUrisToVacuum(List arrayMetaVacUrisToVacuum) { + + this.arrayMetaVacUrisToVacuum = arrayMetaVacUrisToVacuum; + return this; + } + + public ArrayDirectory addArrayMetaVacUrisToVacuumItem(String arrayMetaVacUrisToVacuumItem) { + if (this.arrayMetaVacUrisToVacuum == null) { + this.arrayMetaVacUrisToVacuum = new ArrayList<>(); + } + this.arrayMetaVacUrisToVacuum.add(arrayMetaVacUrisToVacuumItem); + return this; + } + + /** + * the array metadata vac files to vacuum + * @return arrayMetaVacUrisToVacuum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the array metadata vac files to vacuum") + + public List getArrayMetaVacUrisToVacuum() { + return arrayMetaVacUrisToVacuum; + } + + + public void setArrayMetaVacUrisToVacuum(List arrayMetaVacUrisToVacuum) { + this.arrayMetaVacUrisToVacuum = arrayMetaVacUrisToVacuum; + } + + + public ArrayDirectory commitUrisToConsolidate(List commitUrisToConsolidate) { + + this.commitUrisToConsolidate = commitUrisToConsolidate; + return this; + } + + public ArrayDirectory addCommitUrisToConsolidateItem(String commitUrisToConsolidateItem) { + if (this.commitUrisToConsolidate == null) { + this.commitUrisToConsolidate = new ArrayList<>(); + } + this.commitUrisToConsolidate.add(commitUrisToConsolidateItem); + return this; + } + + /** + * the commit files to consolidate + * @return commitUrisToConsolidate + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the commit files to consolidate") + + public List getCommitUrisToConsolidate() { + return commitUrisToConsolidate; + } + + + public void setCommitUrisToConsolidate(List commitUrisToConsolidate) { + this.commitUrisToConsolidate = commitUrisToConsolidate; + } + + + public ArrayDirectory commitUrisToVacuum(List commitUrisToVacuum) { + + this.commitUrisToVacuum = commitUrisToVacuum; + return this; + } + + public ArrayDirectory addCommitUrisToVacuumItem(String commitUrisToVacuumItem) { + if (this.commitUrisToVacuum == null) { + this.commitUrisToVacuum = new ArrayList<>(); + } + this.commitUrisToVacuum.add(commitUrisToVacuumItem); + return this; + } + + /** + * the commit files to vacuum + * @return commitUrisToVacuum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the commit files to vacuum") + + public List getCommitUrisToVacuum() { + return commitUrisToVacuum; + } + + + public void setCommitUrisToVacuum(List commitUrisToVacuum) { + this.commitUrisToVacuum = commitUrisToVacuum; + } + + + public ArrayDirectory consolidatedCommitUrisToVacuum(List consolidatedCommitUrisToVacuum) { + + this.consolidatedCommitUrisToVacuum = consolidatedCommitUrisToVacuum; + return this; + } + + public ArrayDirectory addConsolidatedCommitUrisToVacuumItem(String consolidatedCommitUrisToVacuumItem) { + if (this.consolidatedCommitUrisToVacuum == null) { + this.consolidatedCommitUrisToVacuum = new ArrayList<>(); + } + this.consolidatedCommitUrisToVacuum.add(consolidatedCommitUrisToVacuumItem); + return this; + } + + /** + * the consolidated commit files to vacuum + * @return consolidatedCommitUrisToVacuum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the consolidated commit files to vacuum") + + public List getConsolidatedCommitUrisToVacuum() { + return consolidatedCommitUrisToVacuum; + } + + + public void setConsolidatedCommitUrisToVacuum(List consolidatedCommitUrisToVacuum) { + this.consolidatedCommitUrisToVacuum = consolidatedCommitUrisToVacuum; + } + + + public ArrayDirectory fragmentMetaUris(List fragmentMetaUris) { + + this.fragmentMetaUris = fragmentMetaUris; + return this; + } + + public ArrayDirectory addFragmentMetaUrisItem(String fragmentMetaUrisItem) { + if (this.fragmentMetaUris == null) { + this.fragmentMetaUris = new ArrayList<>(); + } + this.fragmentMetaUris.add(fragmentMetaUrisItem); + return this; + } + + /** + * the URIs of the consolidated fragment metadata files + * @return fragmentMetaUris + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the URIs of the consolidated fragment metadata files") + + public List getFragmentMetaUris() { + return fragmentMetaUris; + } + + + public void setFragmentMetaUris(List fragmentMetaUris) { + this.fragmentMetaUris = fragmentMetaUris; + } + + + public ArrayDirectory timestampStart(BigDecimal timestampStart) { + + this.timestampStart = timestampStart; + return this; + } + + /** + * Only the files created after timestamp_start are listed + * @return timestampStart + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Only the files created after timestamp_start are listed") + + public BigDecimal getTimestampStart() { + return timestampStart; + } + + + public void setTimestampStart(BigDecimal timestampStart) { + this.timestampStart = timestampStart; + } + + + public ArrayDirectory timestampEnd(BigDecimal timestampEnd) { + + this.timestampEnd = timestampEnd; + return this; + } + + /** + * Only the files created before timestamp_end are listed + * @return timestampEnd + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Only the files created before timestamp_end are listed") + + public BigDecimal getTimestampEnd() { + return timestampEnd; + } + + + public void setTimestampEnd(BigDecimal timestampEnd) { + this.timestampEnd = timestampEnd; + } + + + public ArrayDirectory arrayMetaUris(List arrayMetaUris) { + + this.arrayMetaUris = arrayMetaUris; + return this; + } + + public ArrayDirectory addArrayMetaUrisItem(TimestampedURI arrayMetaUrisItem) { + if (this.arrayMetaUris == null) { + this.arrayMetaUris = new ArrayList<>(); + } + this.arrayMetaUris.add(arrayMetaUrisItem); + return this; + } + + /** + * the timestamped filtered array metadata URIs, after removing the ones that need to be vacuumed and those that do not fall within + * @return arrayMetaUris + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the timestamped filtered array metadata URIs, after removing the ones that need to be vacuumed and those that do not fall within") + + public List getArrayMetaUris() { + return arrayMetaUris; + } + + + public void setArrayMetaUris(List arrayMetaUris) { + this.arrayMetaUris = arrayMetaUris; + } + + + public ArrayDirectory deleteAndUpdateTileLocation(List deleteAndUpdateTileLocation) { + + this.deleteAndUpdateTileLocation = deleteAndUpdateTileLocation; + return this; + } + + public ArrayDirectory addDeleteAndUpdateTileLocationItem(DeleteAndUpdateTileLocation deleteAndUpdateTileLocationItem) { + if (this.deleteAndUpdateTileLocation == null) { + this.deleteAndUpdateTileLocation = new ArrayList<>(); + } + this.deleteAndUpdateTileLocation.add(deleteAndUpdateTileLocationItem); + return this; + } + + /** + * the location of delete tiles + * @return deleteAndUpdateTileLocation + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the location of delete tiles") + + public List getDeleteAndUpdateTileLocation() { + return deleteAndUpdateTileLocation; + } + + + public void setDeleteAndUpdateTileLocation(List deleteAndUpdateTileLocation) { + this.deleteAndUpdateTileLocation = deleteAndUpdateTileLocation; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayDirectory putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayDirectory arrayDirectory = (ArrayDirectory) o; + return Objects.equals(this.unfilteredFragmentUris, arrayDirectory.unfilteredFragmentUris) && + Objects.equals(this.consolidatedCommitUris, arrayDirectory.consolidatedCommitUris) && + Objects.equals(this.arraySchemaUris, arrayDirectory.arraySchemaUris) && + Objects.equals(this.latestArraySchemaUri, arrayDirectory.latestArraySchemaUri) && + Objects.equals(this.arrayMetaUrisToVacuum, arrayDirectory.arrayMetaUrisToVacuum) && + Objects.equals(this.arrayMetaVacUrisToVacuum, arrayDirectory.arrayMetaVacUrisToVacuum) && + Objects.equals(this.commitUrisToConsolidate, arrayDirectory.commitUrisToConsolidate) && + Objects.equals(this.commitUrisToVacuum, arrayDirectory.commitUrisToVacuum) && + Objects.equals(this.consolidatedCommitUrisToVacuum, arrayDirectory.consolidatedCommitUrisToVacuum) && + Objects.equals(this.fragmentMetaUris, arrayDirectory.fragmentMetaUris) && + Objects.equals(this.timestampStart, arrayDirectory.timestampStart) && + Objects.equals(this.timestampEnd, arrayDirectory.timestampEnd) && + Objects.equals(this.arrayMetaUris, arrayDirectory.arrayMetaUris) && + Objects.equals(this.deleteAndUpdateTileLocation, arrayDirectory.deleteAndUpdateTileLocation)&& + Objects.equals(this.additionalProperties, arrayDirectory.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(unfilteredFragmentUris, consolidatedCommitUris, arraySchemaUris, latestArraySchemaUri, arrayMetaUrisToVacuum, arrayMetaVacUrisToVacuum, commitUrisToConsolidate, commitUrisToVacuum, consolidatedCommitUrisToVacuum, fragmentMetaUris, timestampStart, timestampEnd, arrayMetaUris, deleteAndUpdateTileLocation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayDirectory {\n"); + sb.append(" unfilteredFragmentUris: ").append(toIndentedString(unfilteredFragmentUris)).append("\n"); + sb.append(" consolidatedCommitUris: ").append(toIndentedString(consolidatedCommitUris)).append("\n"); + sb.append(" arraySchemaUris: ").append(toIndentedString(arraySchemaUris)).append("\n"); + sb.append(" latestArraySchemaUri: ").append(toIndentedString(latestArraySchemaUri)).append("\n"); + sb.append(" arrayMetaUrisToVacuum: ").append(toIndentedString(arrayMetaUrisToVacuum)).append("\n"); + sb.append(" arrayMetaVacUrisToVacuum: ").append(toIndentedString(arrayMetaVacUrisToVacuum)).append("\n"); + sb.append(" commitUrisToConsolidate: ").append(toIndentedString(commitUrisToConsolidate)).append("\n"); + sb.append(" commitUrisToVacuum: ").append(toIndentedString(commitUrisToVacuum)).append("\n"); + sb.append(" consolidatedCommitUrisToVacuum: ").append(toIndentedString(consolidatedCommitUrisToVacuum)).append("\n"); + sb.append(" fragmentMetaUris: ").append(toIndentedString(fragmentMetaUris)).append("\n"); + sb.append(" timestampStart: ").append(toIndentedString(timestampStart)).append("\n"); + sb.append(" timestampEnd: ").append(toIndentedString(timestampEnd)).append("\n"); + sb.append(" arrayMetaUris: ").append(toIndentedString(arrayMetaUris)).append("\n"); + sb.append(" deleteAndUpdateTileLocation: ").append(toIndentedString(deleteAndUpdateTileLocation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("unfilteredFragmentUris"); + openapiFields.add("consolidatedCommitUris"); + openapiFields.add("arraySchemaUris"); + openapiFields.add("latestArraySchemaUri"); + openapiFields.add("arrayMetaUrisToVacuum"); + openapiFields.add("arrayMetaVacUrisToVacuum"); + openapiFields.add("commitUrisToConsolidate"); + openapiFields.add("commitUrisToVacuum"); + openapiFields.add("consolidatedCommitUrisToVacuum"); + openapiFields.add("fragmentMetaUris"); + openapiFields.add("timestampStart"); + openapiFields.add("timestampEnd"); + openapiFields.add("arrayMetaUris"); + openapiFields.add("deleteAndUpdateTileLocation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayDirectory + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayDirectory.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayDirectory is not found in the empty JSON string", ArrayDirectory.openapiRequiredFields.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("unfilteredFragmentUris") != null && !jsonObj.get("unfilteredFragmentUris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `unfilteredFragmentUris` to be an array in the JSON string but got `%s`", jsonObj.get("unfilteredFragmentUris").toString())); + } + // ensure the json data is an array + if (jsonObj.get("consolidatedCommitUris") != null && !jsonObj.get("consolidatedCommitUris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consolidatedCommitUris` to be an array in the JSON string but got `%s`", jsonObj.get("consolidatedCommitUris").toString())); + } + // ensure the json data is an array + if (jsonObj.get("arraySchemaUris") != null && !jsonObj.get("arraySchemaUris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arraySchemaUris` to be an array in the JSON string but got `%s`", jsonObj.get("arraySchemaUris").toString())); + } + if (jsonObj.get("latestArraySchemaUri") != null && !jsonObj.get("latestArraySchemaUri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `latestArraySchemaUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("latestArraySchemaUri").toString())); + } + // ensure the json data is an array + if (jsonObj.get("arrayMetaUrisToVacuum") != null && !jsonObj.get("arrayMetaUrisToVacuum").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrayMetaUrisToVacuum` to be an array in the JSON string but got `%s`", jsonObj.get("arrayMetaUrisToVacuum").toString())); + } + // ensure the json data is an array + if (jsonObj.get("arrayMetaVacUrisToVacuum") != null && !jsonObj.get("arrayMetaVacUrisToVacuum").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrayMetaVacUrisToVacuum` to be an array in the JSON string but got `%s`", jsonObj.get("arrayMetaVacUrisToVacuum").toString())); + } + // ensure the json data is an array + if (jsonObj.get("commitUrisToConsolidate") != null && !jsonObj.get("commitUrisToConsolidate").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `commitUrisToConsolidate` to be an array in the JSON string but got `%s`", jsonObj.get("commitUrisToConsolidate").toString())); + } + // ensure the json data is an array + if (jsonObj.get("commitUrisToVacuum") != null && !jsonObj.get("commitUrisToVacuum").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `commitUrisToVacuum` to be an array in the JSON string but got `%s`", jsonObj.get("commitUrisToVacuum").toString())); + } + // ensure the json data is an array + if (jsonObj.get("consolidatedCommitUrisToVacuum") != null && !jsonObj.get("consolidatedCommitUrisToVacuum").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consolidatedCommitUrisToVacuum` to be an array in the JSON string but got `%s`", jsonObj.get("consolidatedCommitUrisToVacuum").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fragmentMetaUris") != null && !jsonObj.get("fragmentMetaUris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentMetaUris` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentMetaUris").toString())); + } + JsonArray jsonArrayarrayMetaUris = jsonObj.getAsJsonArray("arrayMetaUris"); + if (jsonArrayarrayMetaUris != null) { + // ensure the json data is an array + if (!jsonObj.get("arrayMetaUris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrayMetaUris` to be an array in the JSON string but got `%s`", jsonObj.get("arrayMetaUris").toString())); + } + + // validate the optional field `arrayMetaUris` (array) + for (int i = 0; i < jsonArrayarrayMetaUris.size(); i++) { + TimestampedURI.validateJsonObject(jsonArrayarrayMetaUris.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraydeleteAndUpdateTileLocation = jsonObj.getAsJsonArray("deleteAndUpdateTileLocation"); + if (jsonArraydeleteAndUpdateTileLocation != null) { + // ensure the json data is an array + if (!jsonObj.get("deleteAndUpdateTileLocation").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `deleteAndUpdateTileLocation` to be an array in the JSON string but got `%s`", jsonObj.get("deleteAndUpdateTileLocation").toString())); + } + + // validate the optional field `deleteAndUpdateTileLocation` (array) + for (int i = 0; i < jsonArraydeleteAndUpdateTileLocation.size(); i++) { + DeleteAndUpdateTileLocation.validateJsonObject(jsonArraydeleteAndUpdateTileLocation.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayDirectory.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayDirectory' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayDirectory.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayDirectory value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayDirectory read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayDirectory instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayDirectory given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayDirectory + * @throws IOException if the JSON string is invalid with respect to ArrayDirectory + */ + public static ArrayDirectory fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayDirectory.class); + } + + /** + * Convert an instance of ArrayDirectory 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/v2/model/ArrayFetch.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayFetch.java new file mode 100644 index 0000000..26fb764 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayFetch.java @@ -0,0 +1,296 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Model for opening an array v2 + */ +@ApiModel(description = "Model for opening an array v2") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArrayFetch { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public static final String SERIALIZED_NAME_QUERY_TYPE = "queryType"; + @SerializedName(SERIALIZED_NAME_QUERY_TYPE) + private Querytype queryType; + + public ArrayFetch() { + } + + public ArrayFetch config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + + public ArrayFetch queryType(Querytype queryType) { + + this.queryType = queryType; + return this; + } + + /** + * Get queryType + * @return queryType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Querytype getQueryType() { + return queryType; + } + + + public void setQueryType(Querytype queryType) { + this.queryType = queryType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayFetch putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayFetch arrayFetch = (ArrayFetch) o; + return Objects.equals(this.config, arrayFetch.config) && + Objects.equals(this.queryType, arrayFetch.queryType)&& + Objects.equals(this.additionalProperties, arrayFetch.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, queryType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayFetch {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" queryType: ").append(toIndentedString(queryType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("queryType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayFetch + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayFetch.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayFetch is not found in the empty JSON string", ArrayFetch.openapiRequiredFields.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayFetch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayFetch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayFetch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayFetch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayFetch read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayFetch instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayFetch given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayFetch + * @throws IOException if the JSON string is invalid with respect to ArrayFetch + */ + public static ArrayFetch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayFetch.class); + } + + /** + * Convert an instance of ArrayFetch 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/v2/model/ArrayMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayMetadata.java new file mode 100644 index 0000000..1695d7c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayMetadata.java @@ -0,0 +1,285 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * user's TileDB array metadata + */ +@ApiModel(description = "user's TileDB array metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArrayMetadata { + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + private List entries = null; + + public ArrayMetadata() { + } + + public ArrayMetadata entries(List entries) { + + this.entries = entries; + return this; + } + + public ArrayMetadata addEntriesItem(ArrayMetadataEntry entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * List of metadata entries + * @return entries + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of metadata entries") + + public List getEntries() { + return entries; + } + + + public void setEntries(List entries) { + this.entries = entries; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayMetadata arrayMetadata = (ArrayMetadata) o; + return Objects.equals(this.entries, arrayMetadata.entries)&& + Objects.equals(this.additionalProperties, arrayMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayMetadata {\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("entries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayMetadata + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayMetadata.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayMetadata is not found in the empty JSON string", ArrayMetadata.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + ArrayMetadataEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayMetadata read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayMetadata + * @throws IOException if the JSON string is invalid with respect to ArrayMetadata + */ + public static ArrayMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayMetadata.class); + } + + /** + * Convert an instance of ArrayMetadata 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/v2/model/ArrayMetadataEntry.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayMetadataEntry.java new file mode 100644 index 0000000..86adca5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayMetadataEntry.java @@ -0,0 +1,402 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * key/value pair representing an array metadata map entry + */ +@ApiModel(description = "key/value pair representing an array metadata map entry") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArrayMetadataEntry { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_VALUE_NUM = "valueNum"; + @SerializedName(SERIALIZED_NAME_VALUE_NUM) + private Integer valueNum; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private List value = null; + + public static final String SERIALIZED_NAME_DEL = "del"; + @SerializedName(SERIALIZED_NAME_DEL) + private Boolean del; + + public ArrayMetadataEntry() { + } + + public ArrayMetadataEntry key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public ArrayMetadataEntry type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public ArrayMetadataEntry valueNum(Integer valueNum) { + + this.valueNum = valueNum; + return this; + } + + /** + * Get valueNum + * @return valueNum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getValueNum() { + return valueNum; + } + + + public void setValueNum(Integer valueNum) { + this.valueNum = valueNum; + } + + + public ArrayMetadataEntry value(List value) { + + this.value = value; + return this; + } + + public ArrayMetadataEntry addValueItem(Integer valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getValue() { + return value; + } + + + public void setValue(List value) { + this.value = value; + } + + + public ArrayMetadataEntry del(Boolean del) { + + this.del = del; + return this; + } + + /** + * Get del + * @return del + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getDel() { + return del; + } + + + public void setDel(Boolean del) { + this.del = del; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayMetadataEntry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayMetadataEntry arrayMetadataEntry = (ArrayMetadataEntry) o; + return Objects.equals(this.key, arrayMetadataEntry.key) && + Objects.equals(this.type, arrayMetadataEntry.type) && + Objects.equals(this.valueNum, arrayMetadataEntry.valueNum) && + Objects.equals(this.value, arrayMetadataEntry.value) && + Objects.equals(this.del, arrayMetadataEntry.del)&& + Objects.equals(this.additionalProperties, arrayMetadataEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, type, valueNum, value, del, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayMetadataEntry {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" valueNum: ").append(toIndentedString(valueNum)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" del: ").append(toIndentedString(del)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("type"); + openapiFields.add("valueNum"); + openapiFields.add("value"); + openapiFields.add("del"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayMetadataEntry + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayMetadataEntry.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayMetadataEntry is not found in the empty JSON string", ArrayMetadataEntry.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("key") != null && !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("type") != null && !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("value") != null && !jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayMetadataEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayMetadataEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayMetadataEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayMetadataEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayMetadataEntry read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayMetadataEntry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayMetadataEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayMetadataEntry + * @throws IOException if the JSON string is invalid with respect to ArrayMetadataEntry + */ + public static ArrayMetadataEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayMetadataEntry.class); + } + + /** + * Convert an instance of ArrayMetadataEntry 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/v2/model/ArraySchema.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArraySchema.java new file mode 100644 index 0000000..294ea59 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArraySchema.java @@ -0,0 +1,731 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * ArraySchema during creation or retrieval + */ +@ApiModel(description = "ArraySchema during creation or retrieval") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArraySchema { + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private List version = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ARRAY_TYPE = "arrayType"; + @SerializedName(SERIALIZED_NAME_ARRAY_TYPE) + private ArrayType arrayType; + + public static final String SERIALIZED_NAME_TILE_ORDER = "tileOrder"; + @SerializedName(SERIALIZED_NAME_TILE_ORDER) + private Layout tileOrder; + + public static final String SERIALIZED_NAME_CELL_ORDER = "cellOrder"; + @SerializedName(SERIALIZED_NAME_CELL_ORDER) + private Layout cellOrder; + + public static final String SERIALIZED_NAME_CAPACITY = "capacity"; + @SerializedName(SERIALIZED_NAME_CAPACITY) + private Integer capacity; + + public static final String SERIALIZED_NAME_COORDS_FILTER_PIPELINE = "coordsFilterPipeline"; + @SerializedName(SERIALIZED_NAME_COORDS_FILTER_PIPELINE) + private FilterPipeline coordsFilterPipeline; + + public static final String SERIALIZED_NAME_OFFSET_FILTER_PIPELINE = "offsetFilterPipeline"; + @SerializedName(SERIALIZED_NAME_OFFSET_FILTER_PIPELINE) + private FilterPipeline offsetFilterPipeline; + + public static final String SERIALIZED_NAME_VALIDITY_FILTER_PIPELINE = "validityFilterPipeline"; + @SerializedName(SERIALIZED_NAME_VALIDITY_FILTER_PIPELINE) + private FilterPipeline validityFilterPipeline; + + public static final String SERIALIZED_NAME_DOMAIN = "domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + private Domain domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + private List attributes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ALLOWS_DUPLICATES = "allowsDuplicates"; + @SerializedName(SERIALIZED_NAME_ALLOWS_DUPLICATES) + private Boolean allowsDuplicates; + + public static final String SERIALIZED_NAME_TIMESTAMP_RANGE = "timestampRange"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP_RANGE) + private List timestampRange = null; + + public ArraySchema() { + } + + public ArraySchema uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * URI of schema + * @return uri + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "s3:///test_array", value = "URI of schema") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public ArraySchema name(String name) { + + this.name = name; + return this; + } + + /** + * name of schema + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "name of schema") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ArraySchema version(List version) { + + this.version = version; + return this; + } + + public ArraySchema addVersionItem(Integer versionItem) { + this.version.add(versionItem); + return this; + } + + /** + * file format version + * @return version + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "[1, 3, 0]", required = true, value = "file format version") + + public List getVersion() { + return version; + } + + + public void setVersion(List version) { + this.version = version; + } + + + public ArraySchema arrayType(ArrayType arrayType) { + + this.arrayType = arrayType; + return this; + } + + /** + * Get arrayType + * @return arrayType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public ArrayType getArrayType() { + return arrayType; + } + + + public void setArrayType(ArrayType arrayType) { + this.arrayType = arrayType; + } + + + public ArraySchema tileOrder(Layout tileOrder) { + + this.tileOrder = tileOrder; + return this; + } + + /** + * Get tileOrder + * @return tileOrder + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Layout getTileOrder() { + return tileOrder; + } + + + public void setTileOrder(Layout tileOrder) { + this.tileOrder = tileOrder; + } + + + public ArraySchema cellOrder(Layout cellOrder) { + + this.cellOrder = cellOrder; + return this; + } + + /** + * Get cellOrder + * @return cellOrder + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Layout getCellOrder() { + return cellOrder; + } + + + public void setCellOrder(Layout cellOrder) { + this.cellOrder = cellOrder; + } + + + public ArraySchema capacity(Integer capacity) { + + this.capacity = capacity; + return this; + } + + /** + * Capacity of array + * @return capacity + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "100000", required = true, value = "Capacity of array") + + public Integer getCapacity() { + return capacity; + } + + + public void setCapacity(Integer capacity) { + this.capacity = capacity; + } + + + public ArraySchema coordsFilterPipeline(FilterPipeline coordsFilterPipeline) { + + this.coordsFilterPipeline = coordsFilterPipeline; + return this; + } + + /** + * Get coordsFilterPipeline + * @return coordsFilterPipeline + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public FilterPipeline getCoordsFilterPipeline() { + return coordsFilterPipeline; + } + + + public void setCoordsFilterPipeline(FilterPipeline coordsFilterPipeline) { + this.coordsFilterPipeline = coordsFilterPipeline; + } + + + public ArraySchema offsetFilterPipeline(FilterPipeline offsetFilterPipeline) { + + this.offsetFilterPipeline = offsetFilterPipeline; + return this; + } + + /** + * Get offsetFilterPipeline + * @return offsetFilterPipeline + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public FilterPipeline getOffsetFilterPipeline() { + return offsetFilterPipeline; + } + + + public void setOffsetFilterPipeline(FilterPipeline offsetFilterPipeline) { + this.offsetFilterPipeline = offsetFilterPipeline; + } + + + public ArraySchema validityFilterPipeline(FilterPipeline validityFilterPipeline) { + + this.validityFilterPipeline = validityFilterPipeline; + return this; + } + + /** + * Get validityFilterPipeline + * @return validityFilterPipeline + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public FilterPipeline getValidityFilterPipeline() { + return validityFilterPipeline; + } + + + public void setValidityFilterPipeline(FilterPipeline validityFilterPipeline) { + this.validityFilterPipeline = validityFilterPipeline; + } + + + public ArraySchema domain(Domain domain) { + + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Domain getDomain() { + return domain; + } + + + public void setDomain(Domain domain) { + this.domain = domain; + } + + + public ArraySchema attributes(List attributes) { + + this.attributes = attributes; + return this; + } + + public ArraySchema addAttributesItem(Attribute attributesItem) { + this.attributes.add(attributesItem); + return this; + } + + /** + * Attributes of array + * @return attributes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Attributes of array") + + public List getAttributes() { + return attributes; + } + + + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + + public ArraySchema allowsDuplicates(Boolean allowsDuplicates) { + + this.allowsDuplicates = allowsDuplicates; + return this; + } + + /** + * True if the array allows coordinate duplicates. Applicable only to sparse arrays. + * @return allowsDuplicates + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the array allows coordinate duplicates. Applicable only to sparse arrays.") + + public Boolean getAllowsDuplicates() { + return allowsDuplicates; + } + + + public void setAllowsDuplicates(Boolean allowsDuplicates) { + this.allowsDuplicates = allowsDuplicates; + } + + + public ArraySchema timestampRange(List timestampRange) { + + this.timestampRange = timestampRange; + return this; + } + + public ArraySchema addTimestampRangeItem(Integer timestampRangeItem) { + if (this.timestampRange == null) { + this.timestampRange = new ArrayList<>(); + } + this.timestampRange.add(timestampRangeItem); + return this; + } + + /** + * The list of sizes per range + * @return timestampRange + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of sizes per range") + + public List getTimestampRange() { + return timestampRange; + } + + + public void setTimestampRange(List timestampRange) { + this.timestampRange = timestampRange; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArraySchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArraySchema arraySchema = (ArraySchema) o; + return Objects.equals(this.uri, arraySchema.uri) && + Objects.equals(this.name, arraySchema.name) && + Objects.equals(this.version, arraySchema.version) && + Objects.equals(this.arrayType, arraySchema.arrayType) && + Objects.equals(this.tileOrder, arraySchema.tileOrder) && + Objects.equals(this.cellOrder, arraySchema.cellOrder) && + Objects.equals(this.capacity, arraySchema.capacity) && + Objects.equals(this.coordsFilterPipeline, arraySchema.coordsFilterPipeline) && + Objects.equals(this.offsetFilterPipeline, arraySchema.offsetFilterPipeline) && + Objects.equals(this.validityFilterPipeline, arraySchema.validityFilterPipeline) && + Objects.equals(this.domain, arraySchema.domain) && + Objects.equals(this.attributes, arraySchema.attributes) && + Objects.equals(this.allowsDuplicates, arraySchema.allowsDuplicates) && + Objects.equals(this.timestampRange, arraySchema.timestampRange)&& + Objects.equals(this.additionalProperties, arraySchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(uri, name, version, arrayType, tileOrder, cellOrder, capacity, coordsFilterPipeline, offsetFilterPipeline, validityFilterPipeline, domain, attributes, allowsDuplicates, timestampRange, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArraySchema {\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" arrayType: ").append(toIndentedString(arrayType)).append("\n"); + sb.append(" tileOrder: ").append(toIndentedString(tileOrder)).append("\n"); + sb.append(" cellOrder: ").append(toIndentedString(cellOrder)).append("\n"); + sb.append(" capacity: ").append(toIndentedString(capacity)).append("\n"); + sb.append(" coordsFilterPipeline: ").append(toIndentedString(coordsFilterPipeline)).append("\n"); + sb.append(" offsetFilterPipeline: ").append(toIndentedString(offsetFilterPipeline)).append("\n"); + sb.append(" validityFilterPipeline: ").append(toIndentedString(validityFilterPipeline)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" allowsDuplicates: ").append(toIndentedString(allowsDuplicates)).append("\n"); + sb.append(" timestampRange: ").append(toIndentedString(timestampRange)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uri"); + openapiFields.add("name"); + openapiFields.add("version"); + openapiFields.add("arrayType"); + openapiFields.add("tileOrder"); + openapiFields.add("cellOrder"); + openapiFields.add("capacity"); + openapiFields.add("coordsFilterPipeline"); + openapiFields.add("offsetFilterPipeline"); + openapiFields.add("validityFilterPipeline"); + openapiFields.add("domain"); + openapiFields.add("attributes"); + openapiFields.add("allowsDuplicates"); + openapiFields.add("timestampRange"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("arrayType"); + openapiRequiredFields.add("tileOrder"); + openapiRequiredFields.add("cellOrder"); + openapiRequiredFields.add("capacity"); + openapiRequiredFields.add("coordsFilterPipeline"); + openapiRequiredFields.add("offsetFilterPipeline"); + openapiRequiredFields.add("domain"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArraySchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArraySchema.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArraySchema is not found in the empty JSON string", ArraySchema.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ArraySchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("uri") != null && !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("name") != null && !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())); + } + // ensure the json data is an array + if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be an array in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + // validate the optional field `coordsFilterPipeline` + if (jsonObj.getAsJsonObject("coordsFilterPipeline") != null) { + FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("coordsFilterPipeline")); + } + // validate the optional field `offsetFilterPipeline` + if (jsonObj.getAsJsonObject("offsetFilterPipeline") != null) { + FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("offsetFilterPipeline")); + } + // validate the optional field `validityFilterPipeline` + if (jsonObj.getAsJsonObject("validityFilterPipeline") != null) { + FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("validityFilterPipeline")); + } + // validate the optional field `domain` + if (jsonObj.getAsJsonObject("domain") != null) { + Domain.validateJsonObject(jsonObj.getAsJsonObject("domain")); + } + JsonArray jsonArrayattributes = jsonObj.getAsJsonArray("attributes"); + if (jsonArrayattributes != null) { + // ensure the json data is an array + if (!jsonObj.get("attributes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `attributes` to be an array in the JSON string but got `%s`", jsonObj.get("attributes").toString())); + } + + // validate the optional field `attributes` (array) + for (int i = 0; i < jsonArrayattributes.size(); i++) { + Attribute.validateJsonObject(jsonArrayattributes.get(i).getAsJsonObject()); + }; + } + // ensure the json data is an array + if (jsonObj.get("timestampRange") != null && !jsonObj.get("timestampRange").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `timestampRange` to be an array in the JSON string but got `%s`", jsonObj.get("timestampRange").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArraySchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArraySchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArraySchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArraySchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArraySchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArraySchema instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArraySchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArraySchema + * @throws IOException if the JSON string is invalid with respect to ArraySchema + */ + public static ArraySchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArraySchema.class); + } + + /** + * Convert an instance of ArraySchema 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/v2/model/ArraySchemaEntry.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArraySchemaEntry.java new file mode 100644 index 0000000..6b7b378 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArraySchemaEntry.java @@ -0,0 +1,299 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * key/value pair representing an array schema map entry + */ +@ApiModel(description = "key/value pair representing an array schema map entry") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArraySchemaEntry { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private ArraySchema value; + + public ArraySchemaEntry() { + } + + public ArraySchemaEntry key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public ArraySchemaEntry value(ArraySchema value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArraySchema getValue() { + return value; + } + + + public void setValue(ArraySchema value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArraySchemaEntry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArraySchemaEntry arraySchemaEntry = (ArraySchemaEntry) o; + return Objects.equals(this.key, arraySchemaEntry.key) && + Objects.equals(this.value, arraySchemaEntry.value)&& + Objects.equals(this.additionalProperties, arraySchemaEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArraySchemaEntry {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArraySchemaEntry + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArraySchemaEntry.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArraySchemaEntry is not found in the empty JSON string", ArraySchemaEntry.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("key") != null && !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())); + } + // validate the optional field `value` + if (jsonObj.getAsJsonObject("value") != null) { + ArraySchema.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArraySchemaEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArraySchemaEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArraySchemaEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArraySchemaEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArraySchemaEntry read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArraySchemaEntry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArraySchemaEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArraySchemaEntry + * @throws IOException if the JSON string is invalid with respect to ArraySchemaEntry + */ + public static ArraySchemaEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArraySchemaEntry.class); + } + + /** + * Convert an instance of ArraySchemaEntry 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/v2/model/ArraySchemaMap.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArraySchemaMap.java new file mode 100644 index 0000000..7928310 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArraySchemaMap.java @@ -0,0 +1,285 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * array's schemas + */ +@ApiModel(description = "array's schemas") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ArraySchemaMap { + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + private List entries = null; + + public ArraySchemaMap() { + } + + public ArraySchemaMap entries(List entries) { + + this.entries = entries; + return this; + } + + public ArraySchemaMap addEntriesItem(ArraySchemaEntry entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * List of array schemas entries + * @return entries + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of array schemas entries") + + public List getEntries() { + return entries; + } + + + public void setEntries(List entries) { + this.entries = entries; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArraySchemaMap putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArraySchemaMap arraySchemaMap = (ArraySchemaMap) o; + return Objects.equals(this.entries, arraySchemaMap.entries)&& + Objects.equals(this.additionalProperties, arraySchemaMap.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArraySchemaMap {\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("entries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArraySchemaMap + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArraySchemaMap.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArraySchemaMap is not found in the empty JSON string", ArraySchemaMap.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + ArraySchemaEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArraySchemaMap.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArraySchemaMap' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArraySchemaMap.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArraySchemaMap value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArraySchemaMap read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArraySchemaMap instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArraySchemaMap given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArraySchemaMap + * @throws IOException if the JSON string is invalid with respect to ArraySchemaMap + */ + public static ArraySchemaMap fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArraySchemaMap.class); + } + + /** + * Convert an instance of ArraySchemaMap 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/v2/model/ArrayType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayType.java new file mode 100644 index 0000000..4d733e5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ArrayType.java @@ -0,0 +1,69 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * TileDB array type + */ +@JsonAdapter(ArrayType.Adapter.class) +public enum ArrayType { + + DENSE("dense"), + + SPARSE("sparse"); + + private String value; + + ArrayType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ArrayType fromValue(String value) { + for (ArrayType b : ArrayType.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 ArrayType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ArrayType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ArrayType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/AssetType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AssetType.java new file mode 100644 index 0000000..78c385e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AssetType.java @@ -0,0 +1,95 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Asset types represented as TileDB arrays + */ +@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"); + + 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); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/Attribute.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Attribute.java new file mode 100644 index 0000000..3ece4db --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Attribute.java @@ -0,0 +1,474 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Attribute of array + */ +@ApiModel(description = "Attribute of array") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Attribute { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Datatype type; + + public static final String SERIALIZED_NAME_FILTER_PIPELINE = "filterPipeline"; + @SerializedName(SERIALIZED_NAME_FILTER_PIPELINE) + private FilterPipeline filterPipeline; + + public static final String SERIALIZED_NAME_CELL_VAL_NUM = "cellValNum"; + @SerializedName(SERIALIZED_NAME_CELL_VAL_NUM) + private Integer cellValNum; + + public static final String SERIALIZED_NAME_NULLABLE = "nullable"; + @SerializedName(SERIALIZED_NAME_NULLABLE) + private Boolean nullable; + + public static final String SERIALIZED_NAME_FILL_VALUE_VALIDITY = "fillValueValidity"; + @SerializedName(SERIALIZED_NAME_FILL_VALUE_VALIDITY) + private Boolean fillValueValidity; + + public static final String SERIALIZED_NAME_FILL_VALUE = "fillValue"; + @SerializedName(SERIALIZED_NAME_FILL_VALUE) + private List fillValue = null; + + public Attribute() { + } + + public Attribute name(String name) { + + this.name = name; + return this; + } + + /** + * Attribute name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "attribute1", required = true, value = "Attribute name") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Attribute type(Datatype type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Datatype getType() { + return type; + } + + + public void setType(Datatype type) { + this.type = type; + } + + + public Attribute filterPipeline(FilterPipeline filterPipeline) { + + this.filterPipeline = filterPipeline; + return this; + } + + /** + * Get filterPipeline + * @return filterPipeline + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public FilterPipeline getFilterPipeline() { + return filterPipeline; + } + + + public void setFilterPipeline(FilterPipeline filterPipeline) { + this.filterPipeline = filterPipeline; + } + + + public Attribute cellValNum(Integer cellValNum) { + + this.cellValNum = cellValNum; + return this; + } + + /** + * Attribute number of values per cell + * @return cellValNum + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "1", required = true, value = "Attribute number of values per cell") + + public Integer getCellValNum() { + return cellValNum; + } + + + public void setCellValNum(Integer cellValNum) { + this.cellValNum = cellValNum; + } + + + public Attribute nullable(Boolean nullable) { + + this.nullable = nullable; + return this; + } + + /** + * Is attribute nullable + * @return nullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "Is attribute nullable") + + public Boolean getNullable() { + return nullable; + } + + + public void setNullable(Boolean nullable) { + this.nullable = nullable; + } + + + public Attribute fillValueValidity(Boolean fillValueValidity) { + + this.fillValueValidity = fillValueValidity; + return this; + } + + /** + * Default validity fill value for nullable attributes + * @return fillValueValidity + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "Default validity fill value for nullable attributes") + + public Boolean getFillValueValidity() { + return fillValueValidity; + } + + + public void setFillValueValidity(Boolean fillValueValidity) { + this.fillValueValidity = fillValueValidity; + } + + + public Attribute fillValue(List fillValue) { + + this.fillValue = fillValue; + return this; + } + + public Attribute addFillValueItem(Integer fillValueItem) { + if (this.fillValue == null) { + this.fillValue = new ArrayList<>(); + } + this.fillValue.add(fillValueItem); + return this; + } + + /** + * The default fill value + * @return fillValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The default fill value") + + public List getFillValue() { + return fillValue; + } + + + public void setFillValue(List fillValue) { + this.fillValue = fillValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Attribute putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attribute attribute = (Attribute) o; + return Objects.equals(this.name, attribute.name) && + Objects.equals(this.type, attribute.type) && + Objects.equals(this.filterPipeline, attribute.filterPipeline) && + Objects.equals(this.cellValNum, attribute.cellValNum) && + Objects.equals(this.nullable, attribute.nullable) && + Objects.equals(this.fillValueValidity, attribute.fillValueValidity) && + Objects.equals(this.fillValue, attribute.fillValue)&& + Objects.equals(this.additionalProperties, attribute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, filterPipeline, cellValNum, nullable, fillValueValidity, fillValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Attribute {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" filterPipeline: ").append(toIndentedString(filterPipeline)).append("\n"); + sb.append(" cellValNum: ").append(toIndentedString(cellValNum)).append("\n"); + sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n"); + sb.append(" fillValueValidity: ").append(toIndentedString(fillValueValidity)).append("\n"); + sb.append(" fillValue: ").append(toIndentedString(fillValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("type"); + openapiFields.add("filterPipeline"); + openapiFields.add("cellValNum"); + openapiFields.add("nullable"); + openapiFields.add("fillValueValidity"); + openapiFields.add("fillValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("filterPipeline"); + openapiRequiredFields.add("cellValNum"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Attribute + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Attribute.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Attribute is not found in the empty JSON string", Attribute.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Attribute.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("name") != null && !jsonObj.get("name").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 `filterPipeline` + if (jsonObj.getAsJsonObject("filterPipeline") != null) { + FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("filterPipeline")); + } + // ensure the json data is an array + if (jsonObj.get("fillValue") != null && !jsonObj.get("fillValue").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fillValue` to be an array in the JSON string but got `%s`", jsonObj.get("fillValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Attribute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Attribute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Attribute.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Attribute value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Attribute read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Attribute instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Attribute given an JSON string + * + * @param jsonString JSON string + * @return An instance of Attribute + * @throws IOException if the JSON string is invalid with respect to Attribute + */ + public static Attribute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Attribute.class); + } + + /** + * Convert an instance of Attribute 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/v2/model/AttributeBufferHeader.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AttributeBufferHeader.java new file mode 100644 index 0000000..689880b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AttributeBufferHeader.java @@ -0,0 +1,455 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Represents an attribute buffer header information + */ +@ApiModel(description = "Represents an attribute buffer header information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AttributeBufferHeader { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FIXED_LEN_BUFFER_SIZE_IN_BYTES = "fixedLenBufferSizeInBytes"; + @SerializedName(SERIALIZED_NAME_FIXED_LEN_BUFFER_SIZE_IN_BYTES) + private Integer fixedLenBufferSizeInBytes; + + public static final String SERIALIZED_NAME_VAR_LEN_BUFFER_SIZE_IN_BYTES = "varLenBufferSizeInBytes"; + @SerializedName(SERIALIZED_NAME_VAR_LEN_BUFFER_SIZE_IN_BYTES) + private Integer varLenBufferSizeInBytes; + + public static final String SERIALIZED_NAME_VALIDITY_LEN_BUFFER_SIZE_IN_BYTES = "validityLenBufferSizeInBytes"; + @SerializedName(SERIALIZED_NAME_VALIDITY_LEN_BUFFER_SIZE_IN_BYTES) + private Integer validityLenBufferSizeInBytes; + + public static final String SERIALIZED_NAME_ORIGINAL_FIXED_LEN_BUFFER_SIZE_IN_BYTES = "originalFixedLenBufferSizeInBytes"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_FIXED_LEN_BUFFER_SIZE_IN_BYTES) + private Integer originalFixedLenBufferSizeInBytes; + + public static final String SERIALIZED_NAME_ORIGINAL_VAR_LEN_BUFFER_SIZE_IN_BYTES = "originalVarLenBufferSizeInBytes"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_VAR_LEN_BUFFER_SIZE_IN_BYTES) + private Integer originalVarLenBufferSizeInBytes; + + public static final String SERIALIZED_NAME_ORIGINAL_VALIDITY_LEN_BUFFER_SIZE_IN_BYTES = "originalValidityLenBufferSizeInBytes"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_VALIDITY_LEN_BUFFER_SIZE_IN_BYTES) + private Integer originalValidityLenBufferSizeInBytes; + + public AttributeBufferHeader() { + } + + public AttributeBufferHeader name(String name) { + + this.name = name; + return this; + } + + /** + * Attribute name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "attribute1", required = true, value = "Attribute name") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public AttributeBufferHeader fixedLenBufferSizeInBytes(Integer fixedLenBufferSizeInBytes) { + + this.fixedLenBufferSizeInBytes = fixedLenBufferSizeInBytes; + return this; + } + + /** + * Number of bytes in the fixed-length attribute data buffer (offsets for var-len attributes) + * @return fixedLenBufferSizeInBytes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Number of bytes in the fixed-length attribute data buffer (offsets for var-len attributes)") + + public Integer getFixedLenBufferSizeInBytes() { + return fixedLenBufferSizeInBytes; + } + + + public void setFixedLenBufferSizeInBytes(Integer fixedLenBufferSizeInBytes) { + this.fixedLenBufferSizeInBytes = fixedLenBufferSizeInBytes; + } + + + public AttributeBufferHeader varLenBufferSizeInBytes(Integer varLenBufferSizeInBytes) { + + this.varLenBufferSizeInBytes = varLenBufferSizeInBytes; + return this; + } + + /** + * Number of bytes in the var-length attribute data buffer + * @return varLenBufferSizeInBytes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Number of bytes in the var-length attribute data buffer") + + public Integer getVarLenBufferSizeInBytes() { + return varLenBufferSizeInBytes; + } + + + public void setVarLenBufferSizeInBytes(Integer varLenBufferSizeInBytes) { + this.varLenBufferSizeInBytes = varLenBufferSizeInBytes; + } + + + public AttributeBufferHeader validityLenBufferSizeInBytes(Integer validityLenBufferSizeInBytes) { + + this.validityLenBufferSizeInBytes = validityLenBufferSizeInBytes; + return this; + } + + /** + * Number of bytes for validity in case attribute is nullable + * @return validityLenBufferSizeInBytes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Number of bytes for validity in case attribute is nullable") + + public Integer getValidityLenBufferSizeInBytes() { + return validityLenBufferSizeInBytes; + } + + + public void setValidityLenBufferSizeInBytes(Integer validityLenBufferSizeInBytes) { + this.validityLenBufferSizeInBytes = validityLenBufferSizeInBytes; + } + + + public AttributeBufferHeader originalFixedLenBufferSizeInBytes(Integer originalFixedLenBufferSizeInBytes) { + + this.originalFixedLenBufferSizeInBytes = originalFixedLenBufferSizeInBytes; + return this; + } + + /** + * Original user set number of bytes in the fixed-length attribute data buffer + * @return originalFixedLenBufferSizeInBytes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Original user set number of bytes in the fixed-length attribute data buffer") + + public Integer getOriginalFixedLenBufferSizeInBytes() { + return originalFixedLenBufferSizeInBytes; + } + + + public void setOriginalFixedLenBufferSizeInBytes(Integer originalFixedLenBufferSizeInBytes) { + this.originalFixedLenBufferSizeInBytes = originalFixedLenBufferSizeInBytes; + } + + + public AttributeBufferHeader originalVarLenBufferSizeInBytes(Integer originalVarLenBufferSizeInBytes) { + + this.originalVarLenBufferSizeInBytes = originalVarLenBufferSizeInBytes; + return this; + } + + /** + * Original user set number of bytes in the var-length attribute data buffer + * @return originalVarLenBufferSizeInBytes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Original user set number of bytes in the var-length attribute data buffer") + + public Integer getOriginalVarLenBufferSizeInBytes() { + return originalVarLenBufferSizeInBytes; + } + + + public void setOriginalVarLenBufferSizeInBytes(Integer originalVarLenBufferSizeInBytes) { + this.originalVarLenBufferSizeInBytes = originalVarLenBufferSizeInBytes; + } + + + public AttributeBufferHeader originalValidityLenBufferSizeInBytes(Integer originalValidityLenBufferSizeInBytes) { + + this.originalValidityLenBufferSizeInBytes = originalValidityLenBufferSizeInBytes; + return this; + } + + /** + * Original user set number of bytes in the validity data buffer + * @return originalValidityLenBufferSizeInBytes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Original user set number of bytes in the validity data buffer") + + public Integer getOriginalValidityLenBufferSizeInBytes() { + return originalValidityLenBufferSizeInBytes; + } + + + public void setOriginalValidityLenBufferSizeInBytes(Integer originalValidityLenBufferSizeInBytes) { + this.originalValidityLenBufferSizeInBytes = originalValidityLenBufferSizeInBytes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AttributeBufferHeader putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttributeBufferHeader attributeBufferHeader = (AttributeBufferHeader) o; + return Objects.equals(this.name, attributeBufferHeader.name) && + Objects.equals(this.fixedLenBufferSizeInBytes, attributeBufferHeader.fixedLenBufferSizeInBytes) && + Objects.equals(this.varLenBufferSizeInBytes, attributeBufferHeader.varLenBufferSizeInBytes) && + Objects.equals(this.validityLenBufferSizeInBytes, attributeBufferHeader.validityLenBufferSizeInBytes) && + Objects.equals(this.originalFixedLenBufferSizeInBytes, attributeBufferHeader.originalFixedLenBufferSizeInBytes) && + Objects.equals(this.originalVarLenBufferSizeInBytes, attributeBufferHeader.originalVarLenBufferSizeInBytes) && + Objects.equals(this.originalValidityLenBufferSizeInBytes, attributeBufferHeader.originalValidityLenBufferSizeInBytes)&& + Objects.equals(this.additionalProperties, attributeBufferHeader.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, fixedLenBufferSizeInBytes, varLenBufferSizeInBytes, validityLenBufferSizeInBytes, originalFixedLenBufferSizeInBytes, originalVarLenBufferSizeInBytes, originalValidityLenBufferSizeInBytes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttributeBufferHeader {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fixedLenBufferSizeInBytes: ").append(toIndentedString(fixedLenBufferSizeInBytes)).append("\n"); + sb.append(" varLenBufferSizeInBytes: ").append(toIndentedString(varLenBufferSizeInBytes)).append("\n"); + sb.append(" validityLenBufferSizeInBytes: ").append(toIndentedString(validityLenBufferSizeInBytes)).append("\n"); + sb.append(" originalFixedLenBufferSizeInBytes: ").append(toIndentedString(originalFixedLenBufferSizeInBytes)).append("\n"); + sb.append(" originalVarLenBufferSizeInBytes: ").append(toIndentedString(originalVarLenBufferSizeInBytes)).append("\n"); + sb.append(" originalValidityLenBufferSizeInBytes: ").append(toIndentedString(originalValidityLenBufferSizeInBytes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("fixedLenBufferSizeInBytes"); + openapiFields.add("varLenBufferSizeInBytes"); + openapiFields.add("validityLenBufferSizeInBytes"); + openapiFields.add("originalFixedLenBufferSizeInBytes"); + openapiFields.add("originalVarLenBufferSizeInBytes"); + openapiFields.add("originalValidityLenBufferSizeInBytes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("fixedLenBufferSizeInBytes"); + openapiRequiredFields.add("varLenBufferSizeInBytes"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AttributeBufferHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AttributeBufferHeader.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AttributeBufferHeader is not found in the empty JSON string", AttributeBufferHeader.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AttributeBufferHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AttributeBufferHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AttributeBufferHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AttributeBufferHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AttributeBufferHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AttributeBufferHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AttributeBufferHeader instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AttributeBufferHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of AttributeBufferHeader + * @throws IOException if the JSON string is invalid with respect to AttributeBufferHeader + */ + public static AttributeBufferHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AttributeBufferHeader.class); + } + + /** + * Convert an instance of AttributeBufferHeader 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/v2/model/AttributeBufferSize.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AttributeBufferSize.java new file mode 100644 index 0000000..0a3f7d9 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AttributeBufferSize.java @@ -0,0 +1,335 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * object representing buffer size of an attribute + */ +@ApiModel(description = "object representing buffer size of an attribute") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AttributeBufferSize { + public static final String SERIALIZED_NAME_ATTRIBUTE = "attribute"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTE) + private String attribute; + + public static final String SERIALIZED_NAME_OFFSET_BYTES = "offsetBytes"; + @SerializedName(SERIALIZED_NAME_OFFSET_BYTES) + private Integer offsetBytes; + + public static final String SERIALIZED_NAME_DATA_BYTES = "dataBytes"; + @SerializedName(SERIALIZED_NAME_DATA_BYTES) + private Integer dataBytes; + + public AttributeBufferSize() { + } + + public AttributeBufferSize attribute(String attribute) { + + this.attribute = attribute; + return this; + } + + /** + * name of attribute + * @return attribute + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "name of attribute") + + public String getAttribute() { + return attribute; + } + + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + + public AttributeBufferSize offsetBytes(Integer offsetBytes) { + + this.offsetBytes = offsetBytes; + return this; + } + + /** + * buffer size (in bytes) of offset buffer + * @return offsetBytes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "buffer size (in bytes) of offset buffer") + + public Integer getOffsetBytes() { + return offsetBytes; + } + + + public void setOffsetBytes(Integer offsetBytes) { + this.offsetBytes = offsetBytes; + } + + + public AttributeBufferSize dataBytes(Integer dataBytes) { + + this.dataBytes = dataBytes; + return this; + } + + /** + * buffer size (in bytes) of data buffer + * @return dataBytes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "buffer size (in bytes) of data buffer") + + public Integer getDataBytes() { + return dataBytes; + } + + + public void setDataBytes(Integer dataBytes) { + this.dataBytes = dataBytes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AttributeBufferSize putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttributeBufferSize attributeBufferSize = (AttributeBufferSize) o; + return Objects.equals(this.attribute, attributeBufferSize.attribute) && + Objects.equals(this.offsetBytes, attributeBufferSize.offsetBytes) && + Objects.equals(this.dataBytes, attributeBufferSize.dataBytes)&& + Objects.equals(this.additionalProperties, attributeBufferSize.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attribute, offsetBytes, dataBytes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttributeBufferSize {\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); + sb.append(" offsetBytes: ").append(toIndentedString(offsetBytes)).append("\n"); + sb.append(" dataBytes: ").append(toIndentedString(dataBytes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("attribute"); + openapiFields.add("offsetBytes"); + openapiFields.add("dataBytes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("attribute"); + openapiRequiredFields.add("offsetBytes"); + openapiRequiredFields.add("dataBytes"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AttributeBufferSize + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AttributeBufferSize.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AttributeBufferSize is not found in the empty JSON string", AttributeBufferSize.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AttributeBufferSize.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("attribute") != null && !jsonObj.get("attribute").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attribute` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AttributeBufferSize.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AttributeBufferSize' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AttributeBufferSize.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AttributeBufferSize value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AttributeBufferSize read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AttributeBufferSize instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AttributeBufferSize given an JSON string + * + * @param jsonString JSON string + * @return An instance of AttributeBufferSize + * @throws IOException if the JSON string is invalid with respect to AttributeBufferSize + */ + public static AttributeBufferSize fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AttributeBufferSize.class); + } + + /** + * Convert an instance of AttributeBufferSize 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/v2/model/AzureCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AzureCredential.java new file mode 100644 index 0000000..bc66e50 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AzureCredential.java @@ -0,0 +1,298 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Credential information to access Microsoft Azure. Each supported property is the snake_case version of its name in an Azure Storage connection string. + */ +@ApiModel(description = "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", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AzureCredential { + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "account_name"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + private String accountName; + + public static final String SERIALIZED_NAME_ACCOUNT_KEY = "account_key"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_KEY) + private String accountKey; + + public AzureCredential() { + } + + public AzureCredential accountName(String accountName) { + + this.accountName = accountName; + return this; + } + + /** + * The name of the Azure account to access + * @return accountName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Azure account to access") + + public String getAccountName() { + return accountName; + } + + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + + public AzureCredential accountKey(String accountKey) { + + this.accountKey = accountKey; + return this; + } + + /** + * The secret key. Never returned in responses. + * @return accountKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The secret key. Never returned in responses.") + + public String getAccountKey() { + return accountKey; + } + + + public void setAccountKey(String accountKey) { + this.accountKey = accountKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AzureCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, azureCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, accountKey, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("account_name"); + openapiFields.add("account_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AzureCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AzureCredential.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AzureCredential is not found in the empty JSON string", AzureCredential.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("account_name") != null && !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").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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AzureCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AzureCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/AzureToken.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AzureToken.java new file mode 100644 index 0000000..c6fda4c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/AzureToken.java @@ -0,0 +1,298 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Token information to access Azure services + */ +@ApiModel(description = "Token information to access Azure services") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class AzureToken { + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "account_name"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + private String accountName; + + public static final String SERIALIZED_NAME_SAS_TOKEN = "sas_token"; + @SerializedName(SERIALIZED_NAME_SAS_TOKEN) + private String sasToken; + + public AzureToken() { + } + + public AzureToken accountName(String accountName) { + + this.accountName = accountName; + return this; + } + + /** + * The account name of the configuration + * @return accountName + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "tiledbpoc", value = "The account name of the configuration") + + public String getAccountName() { + return accountName; + } + + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + + public AzureToken sasToken(String sasToken) { + + this.sasToken = sasToken; + return this; + } + + /** + * The token to use for this account + * @return sasToken + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "sv=2022-11-02&ss=bfqt&srt=sco&sp=dsafdssdfafasdfsda&se=2024-03-28T03:02:08Z&st=2024-03-27T19:02:08Z&spr=https&sig=444444555555555555555555555555555555555%3D", value = "The token to use for this account") + + public String getSasToken() { + return sasToken; + } + + + public void setSasToken(String sasToken) { + this.sasToken = sasToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public AzureToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, azureToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, sasToken, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("account_name"); + openapiFields.add("sas_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AzureToken + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AzureToken.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AzureToken is not found in the empty JSON string", AzureToken.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("account_name") != null && !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") != null && !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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AzureToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AzureToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/CloudProvider.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/CloudProvider.java new file mode 100644 index 0000000..b71173e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/CloudProvider.java @@ -0,0 +1,71 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +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); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/Datatype.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Datatype.java new file mode 100644 index 0000000..4c4a3ee --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Datatype.java @@ -0,0 +1,149 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * TileDB data type + */ +@JsonAdapter(Datatype.Adapter.class) +public enum Datatype { + + 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; + + Datatype(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Datatype fromValue(String value) { + for (Datatype b : Datatype.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 Datatype enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Datatype read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Datatype.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/DeleteAndUpdateTileLocation.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/DeleteAndUpdateTileLocation.java new file mode 100644 index 0000000..1490bfe --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/DeleteAndUpdateTileLocation.java @@ -0,0 +1,329 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * the location of delete tiles + */ +@ApiModel(description = "the location of delete tiles") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class DeleteAndUpdateTileLocation { + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_CONDITION_MARKER = "conditionMarker"; + @SerializedName(SERIALIZED_NAME_CONDITION_MARKER) + private String conditionMarker; + + public static final String SERIALIZED_NAME_OFFSET = "offset"; + @SerializedName(SERIALIZED_NAME_OFFSET) + private BigDecimal offset; + + public DeleteAndUpdateTileLocation() { + } + + public DeleteAndUpdateTileLocation uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * the uri + * @return uri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the uri") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public DeleteAndUpdateTileLocation conditionMarker(String conditionMarker) { + + this.conditionMarker = conditionMarker; + return this; + } + + /** + * Get conditionMarker + * @return conditionMarker + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getConditionMarker() { + return conditionMarker; + } + + + public void setConditionMarker(String conditionMarker) { + this.conditionMarker = conditionMarker; + } + + + public DeleteAndUpdateTileLocation offset(BigDecimal offset) { + + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getOffset() { + return offset; + } + + + public void setOffset(BigDecimal offset) { + this.offset = offset; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public DeleteAndUpdateTileLocation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAndUpdateTileLocation deleteAndUpdateTileLocation = (DeleteAndUpdateTileLocation) o; + return Objects.equals(this.uri, deleteAndUpdateTileLocation.uri) && + Objects.equals(this.conditionMarker, deleteAndUpdateTileLocation.conditionMarker) && + Objects.equals(this.offset, deleteAndUpdateTileLocation.offset)&& + Objects.equals(this.additionalProperties, deleteAndUpdateTileLocation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(uri, conditionMarker, offset, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteAndUpdateTileLocation {\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" conditionMarker: ").append(toIndentedString(conditionMarker)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uri"); + openapiFields.add("conditionMarker"); + openapiFields.add("offset"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteAndUpdateTileLocation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeleteAndUpdateTileLocation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteAndUpdateTileLocation is not found in the empty JSON string", DeleteAndUpdateTileLocation.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("uri") != null && !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("conditionMarker") != null && !jsonObj.get("conditionMarker").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `conditionMarker` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conditionMarker").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteAndUpdateTileLocation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteAndUpdateTileLocation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteAndUpdateTileLocation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteAndUpdateTileLocation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteAndUpdateTileLocation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + DeleteAndUpdateTileLocation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteAndUpdateTileLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteAndUpdateTileLocation + * @throws IOException if the JSON string is invalid with respect to DeleteAndUpdateTileLocation + */ + public static DeleteAndUpdateTileLocation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteAndUpdateTileLocation.class); + } + + /** + * Convert an instance of DeleteAndUpdateTileLocation 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/v2/model/Dimension.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Dimension.java new file mode 100644 index 0000000..7d61fb3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Dimension.java @@ -0,0 +1,437 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Dimension of array + */ +@ApiModel(description = "Dimension of array") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Dimension { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Datatype type; + + public static final String SERIALIZED_NAME_DOMAIN = "domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + private DomainArray domain; + + public static final String SERIALIZED_NAME_NULL_TILE_EXTENT = "nullTileExtent"; + @SerializedName(SERIALIZED_NAME_NULL_TILE_EXTENT) + private Boolean nullTileExtent; + + public static final String SERIALIZED_NAME_TILE_EXTENT = "tileExtent"; + @SerializedName(SERIALIZED_NAME_TILE_EXTENT) + private DimensionTileExtent tileExtent; + + public static final String SERIALIZED_NAME_FILTER_PIPELINE = "filterPipeline"; + @SerializedName(SERIALIZED_NAME_FILTER_PIPELINE) + private FilterPipeline filterPipeline; + + public Dimension() { + } + + public Dimension name(String name) { + + this.name = name; + return this; + } + + /** + * Dimension name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "row", value = "Dimension name") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Dimension type(Datatype type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Datatype getType() { + return type; + } + + + public void setType(Datatype type) { + this.type = type; + } + + + public Dimension domain(DomainArray domain) { + + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public DomainArray getDomain() { + return domain; + } + + + public void setDomain(DomainArray domain) { + this.domain = domain; + } + + + public Dimension nullTileExtent(Boolean nullTileExtent) { + + this.nullTileExtent = nullTileExtent; + return this; + } + + /** + * Is tile extent null + * @return nullTileExtent + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "true", required = true, value = "Is tile extent null") + + public Boolean getNullTileExtent() { + return nullTileExtent; + } + + + public void setNullTileExtent(Boolean nullTileExtent) { + this.nullTileExtent = nullTileExtent; + } + + + public Dimension tileExtent(DimensionTileExtent tileExtent) { + + this.tileExtent = tileExtent; + return this; + } + + /** + * Get tileExtent + * @return tileExtent + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public DimensionTileExtent getTileExtent() { + return tileExtent; + } + + + public void setTileExtent(DimensionTileExtent tileExtent) { + this.tileExtent = tileExtent; + } + + + public Dimension filterPipeline(FilterPipeline filterPipeline) { + + this.filterPipeline = filterPipeline; + return this; + } + + /** + * Get filterPipeline + * @return filterPipeline + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public FilterPipeline getFilterPipeline() { + return filterPipeline; + } + + + public void setFilterPipeline(FilterPipeline filterPipeline) { + this.filterPipeline = filterPipeline; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Dimension putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dimension dimension = (Dimension) o; + return Objects.equals(this.name, dimension.name) && + Objects.equals(this.type, dimension.type) && + Objects.equals(this.domain, dimension.domain) && + Objects.equals(this.nullTileExtent, dimension.nullTileExtent) && + Objects.equals(this.tileExtent, dimension.tileExtent) && + Objects.equals(this.filterPipeline, dimension.filterPipeline)&& + Objects.equals(this.additionalProperties, dimension.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, domain, nullTileExtent, tileExtent, filterPipeline, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dimension {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" nullTileExtent: ").append(toIndentedString(nullTileExtent)).append("\n"); + sb.append(" tileExtent: ").append(toIndentedString(tileExtent)).append("\n"); + sb.append(" filterPipeline: ").append(toIndentedString(filterPipeline)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("type"); + openapiFields.add("domain"); + openapiFields.add("nullTileExtent"); + openapiFields.add("tileExtent"); + openapiFields.add("filterPipeline"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("domain"); + openapiRequiredFields.add("nullTileExtent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Dimension + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Dimension.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Dimension is not found in the empty JSON string", Dimension.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dimension.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("name") != null && !jsonObj.get("name").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 `domain` + if (jsonObj.getAsJsonObject("domain") != null) { + DomainArray.validateJsonObject(jsonObj.getAsJsonObject("domain")); + } + // validate the optional field `tileExtent` + if (jsonObj.getAsJsonObject("tileExtent") != null) { + DimensionTileExtent.validateJsonObject(jsonObj.getAsJsonObject("tileExtent")); + } + // validate the optional field `filterPipeline` + if (jsonObj.getAsJsonObject("filterPipeline") != null) { + FilterPipeline.validateJsonObject(jsonObj.getAsJsonObject("filterPipeline")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Dimension.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Dimension' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Dimension.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Dimension value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Dimension read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Dimension instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Dimension given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dimension + * @throws IOException if the JSON string is invalid with respect to Dimension + */ + public static Dimension fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Dimension.class); + } + + /** + * Convert an instance of Dimension 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/v2/model/DimensionTileExtent.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/DimensionTileExtent.java new file mode 100644 index 0000000..49d591c --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/DimensionTileExtent.java @@ -0,0 +1,532 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Extent of tile + */ +@ApiModel(description = "Extent of tile") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class DimensionTileExtent { + public static final String SERIALIZED_NAME_INT8 = "int8"; + @SerializedName(SERIALIZED_NAME_INT8) + private Integer int8; + + public static final String SERIALIZED_NAME_UINT8 = "uint8"; + @SerializedName(SERIALIZED_NAME_UINT8) + private Integer uint8; + + public static final String SERIALIZED_NAME_INT16 = "int16"; + @SerializedName(SERIALIZED_NAME_INT16) + private Integer int16; + + public static final String SERIALIZED_NAME_UINT16 = "uint16"; + @SerializedName(SERIALIZED_NAME_UINT16) + private Integer uint16; + + public static final String SERIALIZED_NAME_INT32 = "int32"; + @SerializedName(SERIALIZED_NAME_INT32) + private Integer int32; + + public static final String SERIALIZED_NAME_UINT32 = "uint32"; + @SerializedName(SERIALIZED_NAME_UINT32) + private Integer uint32; + + public static final String SERIALIZED_NAME_INT64 = "int64"; + @SerializedName(SERIALIZED_NAME_INT64) + private Long int64; + + public static final String SERIALIZED_NAME_UINT64 = "uint64"; + @SerializedName(SERIALIZED_NAME_UINT64) + private Integer uint64; + + public static final String SERIALIZED_NAME_FLOAT32 = "float32"; + @SerializedName(SERIALIZED_NAME_FLOAT32) + private Integer float32; + + public static final String SERIALIZED_NAME_FLOAT64 = "float64"; + @SerializedName(SERIALIZED_NAME_FLOAT64) + private Integer float64; + + public DimensionTileExtent() { + } + + public DimensionTileExtent int8(Integer int8) { + + this.int8 = int8; + return this; + } + + /** + * Get int8 + * @return int8 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt8() { + return int8; + } + + + public void setInt8(Integer int8) { + this.int8 = int8; + } + + + public DimensionTileExtent uint8(Integer uint8) { + + this.uint8 = uint8; + return this; + } + + /** + * Get uint8 + * @return uint8 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint8() { + return uint8; + } + + + public void setUint8(Integer uint8) { + this.uint8 = uint8; + } + + + public DimensionTileExtent int16(Integer int16) { + + this.int16 = int16; + return this; + } + + /** + * Get int16 + * @return int16 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt16() { + return int16; + } + + + public void setInt16(Integer int16) { + this.int16 = int16; + } + + + public DimensionTileExtent uint16(Integer uint16) { + + this.uint16 = uint16; + return this; + } + + /** + * Get uint16 + * @return uint16 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint16() { + return uint16; + } + + + public void setUint16(Integer uint16) { + this.uint16 = uint16; + } + + + public DimensionTileExtent int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt32() { + return int32; + } + + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + + public DimensionTileExtent uint32(Integer uint32) { + + this.uint32 = uint32; + return this; + } + + /** + * Get uint32 + * @return uint32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint32() { + return uint32; + } + + + public void setUint32(Integer uint32) { + this.uint32 = uint32; + } + + + public DimensionTileExtent int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getInt64() { + return int64; + } + + + public void setInt64(Long int64) { + this.int64 = int64; + } + + + public DimensionTileExtent uint64(Integer uint64) { + + this.uint64 = uint64; + return this; + } + + /** + * Get uint64 + * @return uint64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint64() { + return uint64; + } + + + public void setUint64(Integer uint64) { + this.uint64 = uint64; + } + + + public DimensionTileExtent float32(Integer float32) { + + this.float32 = float32; + return this; + } + + /** + * Get float32 + * @return float32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getFloat32() { + return float32; + } + + + public void setFloat32(Integer float32) { + this.float32 = float32; + } + + + public DimensionTileExtent float64(Integer float64) { + + this.float64 = float64; + return this; + } + + /** + * Get float64 + * @return float64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getFloat64() { + return float64; + } + + + public void setFloat64(Integer float64) { + this.float64 = float64; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public DimensionTileExtent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DimensionTileExtent dimensionTileExtent = (DimensionTileExtent) o; + return Objects.equals(this.int8, dimensionTileExtent.int8) && + Objects.equals(this.uint8, dimensionTileExtent.uint8) && + Objects.equals(this.int16, dimensionTileExtent.int16) && + Objects.equals(this.uint16, dimensionTileExtent.uint16) && + Objects.equals(this.int32, dimensionTileExtent.int32) && + Objects.equals(this.uint32, dimensionTileExtent.uint32) && + Objects.equals(this.int64, dimensionTileExtent.int64) && + Objects.equals(this.uint64, dimensionTileExtent.uint64) && + Objects.equals(this.float32, dimensionTileExtent.float32) && + Objects.equals(this.float64, dimensionTileExtent.float64)&& + Objects.equals(this.additionalProperties, dimensionTileExtent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DimensionTileExtent {\n"); + sb.append(" int8: ").append(toIndentedString(int8)).append("\n"); + sb.append(" uint8: ").append(toIndentedString(uint8)).append("\n"); + sb.append(" int16: ").append(toIndentedString(int16)).append("\n"); + sb.append(" uint16: ").append(toIndentedString(uint16)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" uint32: ").append(toIndentedString(uint32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); + sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); + sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("int8"); + openapiFields.add("uint8"); + openapiFields.add("int16"); + openapiFields.add("uint16"); + openapiFields.add("int32"); + openapiFields.add("uint32"); + openapiFields.add("int64"); + openapiFields.add("uint64"); + openapiFields.add("float32"); + openapiFields.add("float64"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DimensionTileExtent + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DimensionTileExtent.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DimensionTileExtent is not found in the empty JSON string", DimensionTileExtent.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DimensionTileExtent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DimensionTileExtent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DimensionTileExtent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DimensionTileExtent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DimensionTileExtent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + DimensionTileExtent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DimensionTileExtent given an JSON string + * + * @param jsonString JSON string + * @return An instance of DimensionTileExtent + * @throws IOException if the JSON string is invalid with respect to DimensionTileExtent + */ + public static DimensionTileExtent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DimensionTileExtent.class); + } + + /** + * Convert an instance of DimensionTileExtent 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/v2/model/Domain.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Domain.java new file mode 100644 index 0000000..8583d36 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Domain.java @@ -0,0 +1,383 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Domain of array + */ +@ApiModel(description = "Domain of array") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Domain { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Datatype type; + + public static final String SERIALIZED_NAME_TILE_ORDER = "tileOrder"; + @SerializedName(SERIALIZED_NAME_TILE_ORDER) + private Layout tileOrder; + + public static final String SERIALIZED_NAME_CELL_ORDER = "cellOrder"; + @SerializedName(SERIALIZED_NAME_CELL_ORDER) + private Layout cellOrder; + + public static final String SERIALIZED_NAME_DIMENSIONS = "dimensions"; + @SerializedName(SERIALIZED_NAME_DIMENSIONS) + private List dimensions = new ArrayList<>(); + + public Domain() { + } + + public Domain type(Datatype type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Datatype getType() { + return type; + } + + + public void setType(Datatype type) { + this.type = type; + } + + + public Domain tileOrder(Layout tileOrder) { + + this.tileOrder = tileOrder; + return this; + } + + /** + * Get tileOrder + * @return tileOrder + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Layout getTileOrder() { + return tileOrder; + } + + + public void setTileOrder(Layout tileOrder) { + this.tileOrder = tileOrder; + } + + + public Domain cellOrder(Layout cellOrder) { + + this.cellOrder = cellOrder; + return this; + } + + /** + * Get cellOrder + * @return cellOrder + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Layout getCellOrder() { + return cellOrder; + } + + + public void setCellOrder(Layout cellOrder) { + this.cellOrder = cellOrder; + } + + + public Domain dimensions(List dimensions) { + + this.dimensions = dimensions; + return this; + } + + public Domain addDimensionsItem(Dimension dimensionsItem) { + this.dimensions.add(dimensionsItem); + return this; + } + + /** + * Array of dimensions + * @return dimensions + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Array of dimensions") + + public List getDimensions() { + return dimensions; + } + + + public void setDimensions(List dimensions) { + this.dimensions = dimensions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Domain putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Domain domain = (Domain) o; + return Objects.equals(this.type, domain.type) && + Objects.equals(this.tileOrder, domain.tileOrder) && + Objects.equals(this.cellOrder, domain.cellOrder) && + Objects.equals(this.dimensions, domain.dimensions)&& + Objects.equals(this.additionalProperties, domain.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, tileOrder, cellOrder, dimensions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Domain {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" tileOrder: ").append(toIndentedString(tileOrder)).append("\n"); + sb.append(" cellOrder: ").append(toIndentedString(cellOrder)).append("\n"); + sb.append(" dimensions: ").append(toIndentedString(dimensions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("tileOrder"); + openapiFields.add("cellOrder"); + openapiFields.add("dimensions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("tileOrder"); + openapiRequiredFields.add("cellOrder"); + openapiRequiredFields.add("dimensions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Domain + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Domain.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Domain is not found in the empty JSON string", Domain.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Domain.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + JsonArray jsonArraydimensions = jsonObj.getAsJsonArray("dimensions"); + if (jsonArraydimensions != null) { + // ensure the json data is an array + if (!jsonObj.get("dimensions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `dimensions` to be an array in the JSON string but got `%s`", jsonObj.get("dimensions").toString())); + } + + // validate the optional field `dimensions` (array) + for (int i = 0; i < jsonArraydimensions.size(); i++) { + Dimension.validateJsonObject(jsonArraydimensions.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Domain.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Domain' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Domain.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Domain value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Domain read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Domain instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Domain given an JSON string + * + * @param jsonString JSON string + * @return An instance of Domain + * @throws IOException if the JSON string is invalid with respect to Domain + */ + public static Domain fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Domain.class); + } + + /** + * Convert an instance of Domain 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/v2/model/DomainArray.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/DomainArray.java new file mode 100644 index 0000000..b260444 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/DomainArray.java @@ -0,0 +1,654 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Domain object for an array of each type + */ +@ApiModel(description = "Domain object for an array of each type") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class DomainArray { + public static final String SERIALIZED_NAME_INT8 = "int8"; + @SerializedName(SERIALIZED_NAME_INT8) + private List int8 = null; + + public static final String SERIALIZED_NAME_UINT8 = "uint8"; + @SerializedName(SERIALIZED_NAME_UINT8) + private List uint8 = null; + + public static final String SERIALIZED_NAME_INT16 = "int16"; + @SerializedName(SERIALIZED_NAME_INT16) + private List int16 = null; + + public static final String SERIALIZED_NAME_UINT16 = "uint16"; + @SerializedName(SERIALIZED_NAME_UINT16) + private List uint16 = null; + + public static final String SERIALIZED_NAME_INT32 = "int32"; + @SerializedName(SERIALIZED_NAME_INT32) + private List int32 = null; + + public static final String SERIALIZED_NAME_UINT32 = "uint32"; + @SerializedName(SERIALIZED_NAME_UINT32) + private List uint32 = null; + + public static final String SERIALIZED_NAME_INT64 = "int64"; + @SerializedName(SERIALIZED_NAME_INT64) + private List int64 = null; + + public static final String SERIALIZED_NAME_UINT64 = "uint64"; + @SerializedName(SERIALIZED_NAME_UINT64) + private List uint64 = null; + + public static final String SERIALIZED_NAME_FLOAT32 = "float32"; + @SerializedName(SERIALIZED_NAME_FLOAT32) + private List float32 = null; + + public static final String SERIALIZED_NAME_FLOAT64 = "float64"; + @SerializedName(SERIALIZED_NAME_FLOAT64) + private List float64 = null; + + public DomainArray() { + } + + public DomainArray int8(List int8) { + + this.int8 = int8; + return this; + } + + public DomainArray addInt8Item(Integer int8Item) { + if (this.int8 == null) { + this.int8 = new ArrayList<>(); + } + this.int8.add(int8Item); + return this; + } + + /** + * Get int8 + * @return int8 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getInt8() { + return int8; + } + + + public void setInt8(List int8) { + this.int8 = int8; + } + + + public DomainArray uint8(List uint8) { + + this.uint8 = uint8; + return this; + } + + public DomainArray addUint8Item(Integer uint8Item) { + if (this.uint8 == null) { + this.uint8 = new ArrayList<>(); + } + this.uint8.add(uint8Item); + return this; + } + + /** + * Get uint8 + * @return uint8 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getUint8() { + return uint8; + } + + + public void setUint8(List uint8) { + this.uint8 = uint8; + } + + + public DomainArray int16(List int16) { + + this.int16 = int16; + return this; + } + + public DomainArray addInt16Item(Integer int16Item) { + if (this.int16 == null) { + this.int16 = new ArrayList<>(); + } + this.int16.add(int16Item); + return this; + } + + /** + * Get int16 + * @return int16 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getInt16() { + return int16; + } + + + public void setInt16(List int16) { + this.int16 = int16; + } + + + public DomainArray uint16(List uint16) { + + this.uint16 = uint16; + return this; + } + + public DomainArray addUint16Item(Integer uint16Item) { + if (this.uint16 == null) { + this.uint16 = new ArrayList<>(); + } + this.uint16.add(uint16Item); + return this; + } + + /** + * Get uint16 + * @return uint16 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getUint16() { + return uint16; + } + + + public void setUint16(List uint16) { + this.uint16 = uint16; + } + + + public DomainArray int32(List int32) { + + this.int32 = int32; + return this; + } + + public DomainArray addInt32Item(Integer int32Item) { + if (this.int32 == null) { + this.int32 = new ArrayList<>(); + } + this.int32.add(int32Item); + return this; + } + + /** + * Get int32 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getInt32() { + return int32; + } + + + public void setInt32(List int32) { + this.int32 = int32; + } + + + public DomainArray uint32(List uint32) { + + this.uint32 = uint32; + return this; + } + + public DomainArray addUint32Item(Integer uint32Item) { + if (this.uint32 == null) { + this.uint32 = new ArrayList<>(); + } + this.uint32.add(uint32Item); + return this; + } + + /** + * Get uint32 + * @return uint32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getUint32() { + return uint32; + } + + + public void setUint32(List uint32) { + this.uint32 = uint32; + } + + + public DomainArray int64(List int64) { + + this.int64 = int64; + return this; + } + + public DomainArray addInt64Item(Long int64Item) { + if (this.int64 == null) { + this.int64 = new ArrayList<>(); + } + this.int64.add(int64Item); + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getInt64() { + return int64; + } + + + public void setInt64(List int64) { + this.int64 = int64; + } + + + public DomainArray uint64(List uint64) { + + this.uint64 = uint64; + return this; + } + + public DomainArray addUint64Item(Integer uint64Item) { + if (this.uint64 == null) { + this.uint64 = new ArrayList<>(); + } + this.uint64.add(uint64Item); + return this; + } + + /** + * Get uint64 + * @return uint64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getUint64() { + return uint64; + } + + + public void setUint64(List uint64) { + this.uint64 = uint64; + } + + + public DomainArray float32(List float32) { + + this.float32 = float32; + return this; + } + + public DomainArray addFloat32Item(Float float32Item) { + if (this.float32 == null) { + this.float32 = new ArrayList<>(); + } + this.float32.add(float32Item); + return this; + } + + /** + * Get float32 + * @return float32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getFloat32() { + return float32; + } + + + public void setFloat32(List float32) { + this.float32 = float32; + } + + + public DomainArray float64(List float64) { + + this.float64 = float64; + return this; + } + + public DomainArray addFloat64Item(Double float64Item) { + if (this.float64 == null) { + this.float64 = new ArrayList<>(); + } + this.float64.add(float64Item); + return this; + } + + /** + * Get float64 + * @return float64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getFloat64() { + return float64; + } + + + public void setFloat64(List float64) { + this.float64 = float64; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public DomainArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DomainArray domainArray = (DomainArray) o; + return Objects.equals(this.int8, domainArray.int8) && + Objects.equals(this.uint8, domainArray.uint8) && + Objects.equals(this.int16, domainArray.int16) && + Objects.equals(this.uint16, domainArray.uint16) && + Objects.equals(this.int32, domainArray.int32) && + Objects.equals(this.uint32, domainArray.uint32) && + Objects.equals(this.int64, domainArray.int64) && + Objects.equals(this.uint64, domainArray.uint64) && + Objects.equals(this.float32, domainArray.float32) && + Objects.equals(this.float64, domainArray.float64)&& + Objects.equals(this.additionalProperties, domainArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DomainArray {\n"); + sb.append(" int8: ").append(toIndentedString(int8)).append("\n"); + sb.append(" uint8: ").append(toIndentedString(uint8)).append("\n"); + sb.append(" int16: ").append(toIndentedString(int16)).append("\n"); + sb.append(" uint16: ").append(toIndentedString(uint16)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" uint32: ").append(toIndentedString(uint32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); + sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); + sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("int8"); + openapiFields.add("uint8"); + openapiFields.add("int16"); + openapiFields.add("uint16"); + openapiFields.add("int32"); + openapiFields.add("uint32"); + openapiFields.add("int64"); + openapiFields.add("uint64"); + openapiFields.add("float32"); + openapiFields.add("float64"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DomainArray + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DomainArray.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DomainArray is not found in the empty JSON string", DomainArray.openapiRequiredFields.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("int8") != null && !jsonObj.get("int8").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `int8` to be an array in the JSON string but got `%s`", jsonObj.get("int8").toString())); + } + // ensure the json data is an array + if (jsonObj.get("uint8") != null && !jsonObj.get("uint8").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uint8` to be an array in the JSON string but got `%s`", jsonObj.get("uint8").toString())); + } + // ensure the json data is an array + if (jsonObj.get("int16") != null && !jsonObj.get("int16").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `int16` to be an array in the JSON string but got `%s`", jsonObj.get("int16").toString())); + } + // ensure the json data is an array + if (jsonObj.get("uint16") != null && !jsonObj.get("uint16").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uint16` to be an array in the JSON string but got `%s`", jsonObj.get("uint16").toString())); + } + // ensure the json data is an array + if (jsonObj.get("int32") != null && !jsonObj.get("int32").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `int32` to be an array in the JSON string but got `%s`", jsonObj.get("int32").toString())); + } + // ensure the json data is an array + if (jsonObj.get("uint32") != null && !jsonObj.get("uint32").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uint32` to be an array in the JSON string but got `%s`", jsonObj.get("uint32").toString())); + } + // ensure the json data is an array + if (jsonObj.get("int64") != null && !jsonObj.get("int64").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `int64` to be an array in the JSON string but got `%s`", jsonObj.get("int64").toString())); + } + // ensure the json data is an array + if (jsonObj.get("uint64") != null && !jsonObj.get("uint64").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uint64` to be an array in the JSON string but got `%s`", jsonObj.get("uint64").toString())); + } + // ensure the json data is an array + if (jsonObj.get("float32") != null && !jsonObj.get("float32").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `float32` to be an array in the JSON string but got `%s`", jsonObj.get("float32").toString())); + } + // ensure the json data is an array + if (jsonObj.get("float64") != null && !jsonObj.get("float64").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `float64` to be an array in the JSON string but got `%s`", jsonObj.get("float64").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DomainArray.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DomainArray' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DomainArray.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DomainArray value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DomainArray read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + DomainArray instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DomainArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of DomainArray + * @throws IOException if the JSON string is invalid with respect to DomainArray + */ + public static DomainArray fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DomainArray.class); + } + + /** + * Convert an instance of DomainArray 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/v2/model/Error.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Error.java new file mode 100644 index 0000000..6721389 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Error.java @@ -0,0 +1,326 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Error + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Error { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private Long code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_ID = "request_id"; + @SerializedName(SERIALIZED_NAME_REQUEST_ID) + private String requestId; + + public Error() { + } + + public Error code(Long code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getCode() { + return code; + } + + + public void setCode(Long code) { + this.code = code; + } + + + public Error message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public Error requestId(String requestId) { + + this.requestId = requestId; + return this; + } + + /** + * Get requestId + * @return requestId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getRequestId() { + return requestId; + } + + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Error putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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.additionalProperties, error.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, requestId, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("message"); + openapiFields.add("request_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Error + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Error.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Error is not found in the empty JSON string", Error.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("message") != null && !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") != null && !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 (!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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Error read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Error instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/FileUploaded.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FileUploaded.java new file mode 100644 index 0000000..6d52857 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FileUploaded.java @@ -0,0 +1,339 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Uploaded file name and information + */ +@ApiModel(description = "Uploaded file name and information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class FileUploaded { + public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; + @SerializedName(SERIALIZED_NAME_OUTPUT_URI) + private String outputUri; + + public static final String SERIALIZED_NAME_FILE_NAME = "file_name"; + @SerializedName(SERIALIZED_NAME_FILE_NAME) + private String fileName; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public FileUploaded() { + } + + public FileUploaded outputUri(String outputUri) { + + this.outputUri = outputUri; + return this; + } + + /** + * output location of the TileDB File + * @return outputUri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "output location of the TileDB File") + + public String getOutputUri() { + return outputUri; + } + + + public void setOutputUri(String outputUri) { + this.outputUri = outputUri; + } + + + public FileUploaded fileName(String fileName) { + + this.fileName = fileName; + return this; + } + + /** + * name of the file uploaded + * @return fileName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "name of the file uploaded") + + public String getFileName() { + return fileName; + } + + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + + public FileUploaded id(String id) { + + this.id = id; + return this; + } + + /** + * unique ID of the uploaded file + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "unique ID of the uploaded file") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public FileUploaded putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileUploaded fileUploaded = (FileUploaded) o; + return Objects.equals(this.outputUri, fileUploaded.outputUri) && + Objects.equals(this.fileName, fileUploaded.fileName) && + Objects.equals(this.id, fileUploaded.id)&& + Objects.equals(this.additionalProperties, fileUploaded.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(outputUri, fileName, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileUploaded {\n"); + sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("output_uri"); + openapiFields.add("file_name"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FileUploaded + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FileUploaded.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FileUploaded is not found in the empty JSON string", FileUploaded.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FileUploaded.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); + } + if (jsonObj.get("file_name") != null && !jsonObj.get("file_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `file_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("file_name").toString())); + } + if (jsonObj.get("id") != null && !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 (!FileUploaded.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileUploaded' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileUploaded.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileUploaded value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FileUploaded read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FileUploaded instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileUploaded given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileUploaded + * @throws IOException if the JSON string is invalid with respect to FileUploaded + */ + public static FileUploaded fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileUploaded.class); + } + + /** + * Convert an instance of FileUploaded 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/v2/model/Filter.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Filter.java new file mode 100644 index 0000000..7bb70e6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Filter.java @@ -0,0 +1,338 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Filter + */ +@ApiModel(description = "Filter") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Filter { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private FilterType type; + + public static final String SERIALIZED_NAME_FLOAT_SCALE_CONFIG = "floatScaleConfig"; + @SerializedName(SERIALIZED_NAME_FLOAT_SCALE_CONFIG) + private FloatScaleConfig floatScaleConfig; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private FilterData data; + + public Filter() { + } + + public Filter type(FilterType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public FilterType getType() { + return type; + } + + + public void setType(FilterType type) { + this.type = type; + } + + + public Filter floatScaleConfig(FloatScaleConfig floatScaleConfig) { + + this.floatScaleConfig = floatScaleConfig; + return this; + } + + /** + * Get floatScaleConfig + * @return floatScaleConfig + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public FloatScaleConfig getFloatScaleConfig() { + return floatScaleConfig; + } + + + public void setFloatScaleConfig(FloatScaleConfig floatScaleConfig) { + this.floatScaleConfig = floatScaleConfig; + } + + + public Filter data(FilterData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public FilterData getData() { + return data; + } + + + public void setData(FilterData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Filter putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Filter filter = (Filter) o; + return Objects.equals(this.type, filter.type) && + Objects.equals(this.floatScaleConfig, filter.floatScaleConfig) && + Objects.equals(this.data, filter.data)&& + Objects.equals(this.additionalProperties, filter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, floatScaleConfig, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Filter {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" floatScaleConfig: ").append(toIndentedString(floatScaleConfig)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("floatScaleConfig"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Filter + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Filter.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Filter is not found in the empty JSON string", Filter.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Filter.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `floatScaleConfig` + if (jsonObj.getAsJsonObject("floatScaleConfig") != null) { + FloatScaleConfig.validateJsonObject(jsonObj.getAsJsonObject("floatScaleConfig")); + } + // validate the optional field `data` + if (jsonObj.getAsJsonObject("data") != null) { + FilterData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Filter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Filter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Filter.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Filter value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Filter read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Filter instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Filter given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter + * @throws IOException if the JSON string is invalid with respect to Filter + */ + public static Filter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Filter.class); + } + + /** + * Convert an instance of Filter 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/v2/model/FilterData.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FilterData.java new file mode 100644 index 0000000..dfa1af2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FilterData.java @@ -0,0 +1,609 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Filter data + */ +@ApiModel(description = "Filter data") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class FilterData { + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_BYTES = "bytes"; + @SerializedName(SERIALIZED_NAME_BYTES) + private List bytes = null; + + public static final String SERIALIZED_NAME_INT8 = "int8"; + @SerializedName(SERIALIZED_NAME_INT8) + private Integer int8; + + public static final String SERIALIZED_NAME_UINT8 = "uint8"; + @SerializedName(SERIALIZED_NAME_UINT8) + private Integer uint8; + + public static final String SERIALIZED_NAME_INT16 = "int16"; + @SerializedName(SERIALIZED_NAME_INT16) + private Integer int16; + + public static final String SERIALIZED_NAME_UINT16 = "uint16"; + @SerializedName(SERIALIZED_NAME_UINT16) + private Integer uint16; + + public static final String SERIALIZED_NAME_INT32 = "int32"; + @SerializedName(SERIALIZED_NAME_INT32) + private Integer int32; + + public static final String SERIALIZED_NAME_UINT32 = "uint32"; + @SerializedName(SERIALIZED_NAME_UINT32) + private Integer uint32; + + public static final String SERIALIZED_NAME_INT64 = "int64"; + @SerializedName(SERIALIZED_NAME_INT64) + private Long int64; + + public static final String SERIALIZED_NAME_UINT64 = "uint64"; + @SerializedName(SERIALIZED_NAME_UINT64) + private Integer uint64; + + public static final String SERIALIZED_NAME_FLOAT32 = "float32"; + @SerializedName(SERIALIZED_NAME_FLOAT32) + private Integer float32; + + public static final String SERIALIZED_NAME_FLOAT64 = "float64"; + @SerializedName(SERIALIZED_NAME_FLOAT64) + private Integer float64; + + public FilterData() { + } + + public FilterData text(String text) { + + this.text = text; + return this; + } + + /** + * Get text + * @return text + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getText() { + return text; + } + + + public void setText(String text) { + this.text = text; + } + + + public FilterData bytes(List bytes) { + + this.bytes = bytes; + return this; + } + + public FilterData addBytesItem(Integer bytesItem) { + if (this.bytes == null) { + this.bytes = new ArrayList<>(); + } + this.bytes.add(bytesItem); + return this; + } + + /** + * Get bytes + * @return bytes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getBytes() { + return bytes; + } + + + public void setBytes(List bytes) { + this.bytes = bytes; + } + + + public FilterData int8(Integer int8) { + + this.int8 = int8; + return this; + } + + /** + * Get int8 + * @return int8 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt8() { + return int8; + } + + + public void setInt8(Integer int8) { + this.int8 = int8; + } + + + public FilterData uint8(Integer uint8) { + + this.uint8 = uint8; + return this; + } + + /** + * Get uint8 + * @return uint8 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint8() { + return uint8; + } + + + public void setUint8(Integer uint8) { + this.uint8 = uint8; + } + + + public FilterData int16(Integer int16) { + + this.int16 = int16; + return this; + } + + /** + * Get int16 + * @return int16 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt16() { + return int16; + } + + + public void setInt16(Integer int16) { + this.int16 = int16; + } + + + public FilterData uint16(Integer uint16) { + + this.uint16 = uint16; + return this; + } + + /** + * Get uint16 + * @return uint16 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint16() { + return uint16; + } + + + public void setUint16(Integer uint16) { + this.uint16 = uint16; + } + + + public FilterData int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt32() { + return int32; + } + + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + + public FilterData uint32(Integer uint32) { + + this.uint32 = uint32; + return this; + } + + /** + * Get uint32 + * @return uint32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint32() { + return uint32; + } + + + public void setUint32(Integer uint32) { + this.uint32 = uint32; + } + + + public FilterData int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getInt64() { + return int64; + } + + + public void setInt64(Long int64) { + this.int64 = int64; + } + + + public FilterData uint64(Integer uint64) { + + this.uint64 = uint64; + return this; + } + + /** + * Get uint64 + * @return uint64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getUint64() { + return uint64; + } + + + public void setUint64(Integer uint64) { + this.uint64 = uint64; + } + + + public FilterData float32(Integer float32) { + + this.float32 = float32; + return this; + } + + /** + * Get float32 + * @return float32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getFloat32() { + return float32; + } + + + public void setFloat32(Integer float32) { + this.float32 = float32; + } + + + public FilterData float64(Integer float64) { + + this.float64 = float64; + return this; + } + + /** + * Get float64 + * @return float64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getFloat64() { + return float64; + } + + + public void setFloat64(Integer float64) { + this.float64 = float64; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public FilterData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FilterData filterData = (FilterData) o; + return Objects.equals(this.text, filterData.text) && + Objects.equals(this.bytes, filterData.bytes) && + Objects.equals(this.int8, filterData.int8) && + Objects.equals(this.uint8, filterData.uint8) && + Objects.equals(this.int16, filterData.int16) && + Objects.equals(this.uint16, filterData.uint16) && + Objects.equals(this.int32, filterData.int32) && + Objects.equals(this.uint32, filterData.uint32) && + Objects.equals(this.int64, filterData.int64) && + Objects.equals(this.uint64, filterData.uint64) && + Objects.equals(this.float32, filterData.float32) && + Objects.equals(this.float64, filterData.float64)&& + Objects.equals(this.additionalProperties, filterData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(text, bytes, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FilterData {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" bytes: ").append(toIndentedString(bytes)).append("\n"); + sb.append(" int8: ").append(toIndentedString(int8)).append("\n"); + sb.append(" uint8: ").append(toIndentedString(uint8)).append("\n"); + sb.append(" int16: ").append(toIndentedString(int16)).append("\n"); + sb.append(" uint16: ").append(toIndentedString(uint16)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" uint32: ").append(toIndentedString(uint32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" uint64: ").append(toIndentedString(uint64)).append("\n"); + sb.append(" float32: ").append(toIndentedString(float32)).append("\n"); + sb.append(" float64: ").append(toIndentedString(float64)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("text"); + openapiFields.add("bytes"); + openapiFields.add("int8"); + openapiFields.add("uint8"); + openapiFields.add("int16"); + openapiFields.add("uint16"); + openapiFields.add("int32"); + openapiFields.add("uint32"); + openapiFields.add("int64"); + openapiFields.add("uint64"); + openapiFields.add("float32"); + openapiFields.add("float64"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FilterData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FilterData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FilterData is not found in the empty JSON string", FilterData.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("text") != null && !jsonObj.get("text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString())); + } + // ensure the json data is an array + if (jsonObj.get("bytes") != null && !jsonObj.get("bytes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `bytes` to be an array in the JSON string but got `%s`", jsonObj.get("bytes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FilterData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FilterData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FilterData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FilterData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FilterData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FilterData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FilterData given an JSON string + * + * @param jsonString JSON string + * @return An instance of FilterData + * @throws IOException if the JSON string is invalid with respect to FilterData + */ + public static FilterData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FilterData.class); + } + + /** + * Convert an instance of FilterData 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/v2/model/FilterPipeline.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FilterPipeline.java new file mode 100644 index 0000000..bcf39a1 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FilterPipeline.java @@ -0,0 +1,285 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * One or more filters to apply + */ +@ApiModel(description = "One or more filters to apply") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class FilterPipeline { + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + private List filters = null; + + public FilterPipeline() { + } + + public FilterPipeline filters(List filters) { + + this.filters = filters; + return this; + } + + public FilterPipeline addFiltersItem(Filter filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Get filters + * @return filters + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getFilters() { + return filters; + } + + + public void setFilters(List filters) { + this.filters = filters; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public FilterPipeline putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FilterPipeline filterPipeline = (FilterPipeline) o; + return Objects.equals(this.filters, filterPipeline.filters)&& + Objects.equals(this.additionalProperties, filterPipeline.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FilterPipeline {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FilterPipeline + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FilterPipeline.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FilterPipeline is not found in the empty JSON string", FilterPipeline.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); + if (jsonArrayfilters != null) { + // ensure the json data is an array + if (!jsonObj.get("filters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `filters` to be an array in the JSON string but got `%s`", jsonObj.get("filters").toString())); + } + + // validate the optional field `filters` (array) + for (int i = 0; i < jsonArrayfilters.size(); i++) { + Filter.validateJsonObject(jsonArrayfilters.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FilterPipeline.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FilterPipeline' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FilterPipeline.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FilterPipeline value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FilterPipeline read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FilterPipeline instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FilterPipeline given an JSON string + * + * @param jsonString JSON string + * @return An instance of FilterPipeline + * @throws IOException if the JSON string is invalid with respect to FilterPipeline + */ + public static FilterPipeline fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FilterPipeline.class); + } + + /** + * Convert an instance of FilterPipeline 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/v2/model/FilterType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FilterType.java new file mode 100644 index 0000000..a21df01 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FilterType.java @@ -0,0 +1,97 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * TileDB filter types + */ +@JsonAdapter(FilterType.Adapter.class) +public enum FilterType { + + NONE("FILTER_NONE"), + + GZIP("FILTER_GZIP"), + + ZSTD("FILTER_ZSTD"), + + LZ4("FILTER_LZ4"), + + RLE("FILTER_RLE"), + + BZIP2("FILTER_BZIP2"), + + DOUBLE_DELTA("FILTER_DOUBLE_DELTA"), + + BIT_WIDTH_REDUCTION("FILTER_BIT_WIDTH_REDUCTION"), + + BITSHUFFLE("FILTER_BITSHUFFLE"), + + BYTESHUFFLE("FILTER_BYTESHUFFLE"), + + POSITIVE_DELTA("FILTER_POSITIVE_DELTA"), + + SCALE_FLOAT("FILTER_SCALE_FLOAT"), + + WEBP("FILTER_WEBP"), + + CHECKSUM_MD5("FILTER_CHECKSUM_MD5"), + + CHECKSUM_SHA256("FILTER_CHECKSUM_SHA256"), + + DICTIONARY("FILTER_DICTIONARY"); + + private String value; + + FilterType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FilterType fromValue(String value) { + for (FilterType b : FilterType.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 FilterType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FilterType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FilterType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/FloatScaleConfig.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FloatScaleConfig.java new file mode 100644 index 0000000..be9c3f8 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FloatScaleConfig.java @@ -0,0 +1,322 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * FloatScaleConfig + */ +@ApiModel(description = "FloatScaleConfig") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class FloatScaleConfig { + public static final String SERIALIZED_NAME_SCALE = "scale"; + @SerializedName(SERIALIZED_NAME_SCALE) + private Integer scale; + + public static final String SERIALIZED_NAME_OFFSET = "offset"; + @SerializedName(SERIALIZED_NAME_OFFSET) + private Integer offset; + + public static final String SERIALIZED_NAME_BYTE_WIDTH = "byteWidth"; + @SerializedName(SERIALIZED_NAME_BYTE_WIDTH) + private Integer byteWidth; + + public FloatScaleConfig() { + } + + public FloatScaleConfig scale(Integer scale) { + + this.scale = scale; + return this; + } + + /** + * Get scale + * @return scale + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getScale() { + return scale; + } + + + public void setScale(Integer scale) { + this.scale = scale; + } + + + public FloatScaleConfig offset(Integer offset) { + + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getOffset() { + return offset; + } + + + public void setOffset(Integer offset) { + this.offset = offset; + } + + + public FloatScaleConfig byteWidth(Integer byteWidth) { + + this.byteWidth = byteWidth; + return this; + } + + /** + * Get byteWidth + * @return byteWidth + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getByteWidth() { + return byteWidth; + } + + + public void setByteWidth(Integer byteWidth) { + this.byteWidth = byteWidth; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public FloatScaleConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FloatScaleConfig floatScaleConfig = (FloatScaleConfig) o; + return Objects.equals(this.scale, floatScaleConfig.scale) && + Objects.equals(this.offset, floatScaleConfig.offset) && + Objects.equals(this.byteWidth, floatScaleConfig.byteWidth)&& + Objects.equals(this.additionalProperties, floatScaleConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(scale, offset, byteWidth, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FloatScaleConfig {\n"); + sb.append(" scale: ").append(toIndentedString(scale)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" byteWidth: ").append(toIndentedString(byteWidth)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("scale"); + openapiFields.add("offset"); + openapiFields.add("byteWidth"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FloatScaleConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FloatScaleConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FloatScaleConfig is not found in the empty JSON string", FloatScaleConfig.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FloatScaleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FloatScaleConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FloatScaleConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FloatScaleConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FloatScaleConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FloatScaleConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FloatScaleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of FloatScaleConfig + * @throws IOException if the JSON string is invalid with respect to FloatScaleConfig + */ + public static FloatScaleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FloatScaleConfig.class); + } + + /** + * Convert an instance of FloatScaleConfig 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/v2/model/FragmentMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FragmentMetadata.java new file mode 100644 index 0000000..ff198aa --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/FragmentMetadata.java @@ -0,0 +1,1333 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Metadata of a fragment + */ +@ApiModel(description = "Metadata of a fragment") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class FragmentMetadata { + public static final String SERIALIZED_NAME_FILE_SIZES = "fileSizes"; + @SerializedName(SERIALIZED_NAME_FILE_SIZES) + private List fileSizes = null; + + public static final String SERIALIZED_NAME_FILE_VAR_SIZES = "fileVarSizes"; + @SerializedName(SERIALIZED_NAME_FILE_VAR_SIZES) + private List fileVarSizes = null; + + public static final String SERIALIZED_NAME_FILE_VALIDITY_SIZES = "fileValiditySizes"; + @SerializedName(SERIALIZED_NAME_FILE_VALIDITY_SIZES) + private List fileValiditySizes = null; + + public static final String SERIALIZED_NAME_FRAGMENT_URI = "fragmentUri"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_URI) + private String fragmentUri; + + public static final String SERIALIZED_NAME_HAS_TIMESTAMPS = "hasTimestamps"; + @SerializedName(SERIALIZED_NAME_HAS_TIMESTAMPS) + private Boolean hasTimestamps; + + public static final String SERIALIZED_NAME_HAS_DELETE_META = "hasDeleteMeta"; + @SerializedName(SERIALIZED_NAME_HAS_DELETE_META) + private Boolean hasDeleteMeta; + + public static final String SERIALIZED_NAME_SPARSE_TILE_NUM = "sparseTileNum"; + @SerializedName(SERIALIZED_NAME_SPARSE_TILE_NUM) + private BigDecimal sparseTileNum; + + public static final String SERIALIZED_NAME_TILE_INDEX_BASE = "tileIndexBase"; + @SerializedName(SERIALIZED_NAME_TILE_INDEX_BASE) + private BigDecimal tileIndexBase; + + public static final String SERIALIZED_NAME_TILE_OFFSETS = "tileOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_OFFSETS) + private List> tileOffsets = null; + + public static final String SERIALIZED_NAME_TILE_VAR_OFFSETS = "tileVarOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_VAR_OFFSETS) + private List> tileVarOffsets = null; + + public static final String SERIALIZED_NAME_TILE_VAR_SIZES = "tileVarSizes"; + @SerializedName(SERIALIZED_NAME_TILE_VAR_SIZES) + private List> tileVarSizes = null; + + public static final String SERIALIZED_NAME_TILE_VALIDITY_OFFSETS = "tileValidityOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_VALIDITY_OFFSETS) + private List> tileValidityOffsets = null; + + public static final String SERIALIZED_NAME_TILE_MIN_BUFFER = "tileMinBuffer"; + @SerializedName(SERIALIZED_NAME_TILE_MIN_BUFFER) + private List> tileMinBuffer = null; + + public static final String SERIALIZED_NAME_TILE_MIN_VAR_BUFFER = "tileMinVarBuffer"; + @SerializedName(SERIALIZED_NAME_TILE_MIN_VAR_BUFFER) + private List> tileMinVarBuffer = null; + + public static final String SERIALIZED_NAME_TILE_MAX_BUFFER = "tileMaxBuffer"; + @SerializedName(SERIALIZED_NAME_TILE_MAX_BUFFER) + private List> tileMaxBuffer = null; + + public static final String SERIALIZED_NAME_TILE_MAX_VAR_BUFFER = "tileMaxVarBuffer"; + @SerializedName(SERIALIZED_NAME_TILE_MAX_VAR_BUFFER) + private List> tileMaxVarBuffer = null; + + public static final String SERIALIZED_NAME_TILE_SUMS = "tileSums"; + @SerializedName(SERIALIZED_NAME_TILE_SUMS) + private List> tileSums = null; + + public static final String SERIALIZED_NAME_TILE_NULL_COUNTS = "tileNullCounts"; + @SerializedName(SERIALIZED_NAME_TILE_NULL_COUNTS) + private List> tileNullCounts = null; + + public static final String SERIALIZED_NAME_FRAGMENT_MINS = "fragmentMins"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_MINS) + private List> fragmentMins = null; + + public static final String SERIALIZED_NAME_FRAGMENT_MAXS = "fragmentMaxs"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_MAXS) + private List> fragmentMaxs = null; + + public static final String SERIALIZED_NAME_FRAGMENT_SUMS = "fragmentSums"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_SUMS) + private List fragmentSums = null; + + public static final String SERIALIZED_NAME_FRAGMENT_NULL_COUNTS = "fragmentNullCounts"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_NULL_COUNTS) + private List fragmentNullCounts = null; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private Integer version; + + public static final String SERIALIZED_NAME_TIMESTAMP_RANGE = "timestampRange"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP_RANGE) + private List timestampRange = null; + + public static final String SERIALIZED_NAME_LAST_TILE_CELL_NUM = "lastTileCellNum"; + @SerializedName(SERIALIZED_NAME_LAST_TILE_CELL_NUM) + private Integer lastTileCellNum; + + public static final String SERIALIZED_NAME_NON_EMPTY_DOMAIN = "nonEmptyDomain"; + @SerializedName(SERIALIZED_NAME_NON_EMPTY_DOMAIN) + private NonEmptyDomainList nonEmptyDomain; + + public static final String SERIALIZED_NAME_RTREE = "rtree"; + @SerializedName(SERIALIZED_NAME_RTREE) + private File rtree; + + public static final String SERIALIZED_NAME_HAS_CONSOLIDATED_FOOTER = "hasConsolidatedFooter"; + @SerializedName(SERIALIZED_NAME_HAS_CONSOLIDATED_FOOTER) + private Boolean hasConsolidatedFooter; + + public static final String SERIALIZED_NAME_GT_OFFSETS = "gtOffsets"; + @SerializedName(SERIALIZED_NAME_GT_OFFSETS) + private GenericTileOffsets gtOffsets; + + public FragmentMetadata() { + } + + public FragmentMetadata fileSizes(List fileSizes) { + + this.fileSizes = fileSizes; + return this; + } + + public FragmentMetadata addFileSizesItem(BigDecimal fileSizesItem) { + if (this.fileSizes == null) { + this.fileSizes = new ArrayList<>(); + } + this.fileSizes.add(fileSizesItem); + return this; + } + + /** + * The size of each attribute file + * @return fileSizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The size of each attribute file") + + public List getFileSizes() { + return fileSizes; + } + + + public void setFileSizes(List fileSizes) { + this.fileSizes = fileSizes; + } + + + public FragmentMetadata fileVarSizes(List fileVarSizes) { + + this.fileVarSizes = fileVarSizes; + return this; + } + + public FragmentMetadata addFileVarSizesItem(BigDecimal fileVarSizesItem) { + if (this.fileVarSizes == null) { + this.fileVarSizes = new ArrayList<>(); + } + this.fileVarSizes.add(fileVarSizesItem); + return this; + } + + /** + * The size of each var attribute file + * @return fileVarSizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The size of each var attribute file") + + public List getFileVarSizes() { + return fileVarSizes; + } + + + public void setFileVarSizes(List fileVarSizes) { + this.fileVarSizes = fileVarSizes; + } + + + public FragmentMetadata fileValiditySizes(List fileValiditySizes) { + + this.fileValiditySizes = fileValiditySizes; + return this; + } + + public FragmentMetadata addFileValiditySizesItem(BigDecimal fileValiditySizesItem) { + if (this.fileValiditySizes == null) { + this.fileValiditySizes = new ArrayList<>(); + } + this.fileValiditySizes.add(fileValiditySizesItem); + return this; + } + + /** + * The size of each validity attribute file + * @return fileValiditySizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The size of each validity attribute file") + + public List getFileValiditySizes() { + return fileValiditySizes; + } + + + public void setFileValiditySizes(List fileValiditySizes) { + this.fileValiditySizes = fileValiditySizes; + } + + + public FragmentMetadata fragmentUri(String fragmentUri) { + + this.fragmentUri = fragmentUri; + return this; + } + + /** + * The uri of the fragment this metadata belongs to + * @return fragmentUri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The uri of the fragment this metadata belongs to") + + public String getFragmentUri() { + return fragmentUri; + } + + + public void setFragmentUri(String fragmentUri) { + this.fragmentUri = fragmentUri; + } + + + public FragmentMetadata hasTimestamps(Boolean hasTimestamps) { + + this.hasTimestamps = hasTimestamps; + return this; + } + + /** + * True if the fragment has timestamps + * @return hasTimestamps + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the fragment has timestamps") + + public Boolean getHasTimestamps() { + return hasTimestamps; + } + + + public void setHasTimestamps(Boolean hasTimestamps) { + this.hasTimestamps = hasTimestamps; + } + + + public FragmentMetadata hasDeleteMeta(Boolean hasDeleteMeta) { + + this.hasDeleteMeta = hasDeleteMeta; + return this; + } + + /** + * True if the fragment has delete metadata + * @return hasDeleteMeta + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the fragment has delete metadata") + + public Boolean getHasDeleteMeta() { + return hasDeleteMeta; + } + + + public void setHasDeleteMeta(Boolean hasDeleteMeta) { + this.hasDeleteMeta = hasDeleteMeta; + } + + + public FragmentMetadata sparseTileNum(BigDecimal sparseTileNum) { + + this.sparseTileNum = sparseTileNum; + return this; + } + + /** + * The number of sparse tiles + * @return sparseTileNum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The number of sparse tiles") + + public BigDecimal getSparseTileNum() { + return sparseTileNum; + } + + + public void setSparseTileNum(BigDecimal sparseTileNum) { + this.sparseTileNum = sparseTileNum; + } + + + public FragmentMetadata tileIndexBase(BigDecimal tileIndexBase) { + + this.tileIndexBase = tileIndexBase; + return this; + } + + /** + * Used to track the tile index base between global order writes + * @return tileIndexBase + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Used to track the tile index base between global order writes") + + public BigDecimal getTileIndexBase() { + return tileIndexBase; + } + + + public void setTileIndexBase(BigDecimal tileIndexBase) { + this.tileIndexBase = tileIndexBase; + } + + + public FragmentMetadata tileOffsets(List> tileOffsets) { + + this.tileOffsets = tileOffsets; + return this; + } + + public FragmentMetadata addTileOffsetsItem(List tileOffsetsItem) { + if (this.tileOffsets == null) { + this.tileOffsets = new ArrayList<>(); + } + this.tileOffsets.add(tileOffsetsItem); + return this; + } + + /** + * Tile offsets in their attribute files + * @return tileOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Tile offsets in their attribute files") + + public List> getTileOffsets() { + return tileOffsets; + } + + + public void setTileOffsets(List> tileOffsets) { + this.tileOffsets = tileOffsets; + } + + + public FragmentMetadata tileVarOffsets(List> tileVarOffsets) { + + this.tileVarOffsets = tileVarOffsets; + return this; + } + + public FragmentMetadata addTileVarOffsetsItem(List tileVarOffsetsItem) { + if (this.tileVarOffsets == null) { + this.tileVarOffsets = new ArrayList<>(); + } + this.tileVarOffsets.add(tileVarOffsetsItem); + return this; + } + + /** + * Variable tile offsets in their attribute files + * @return tileVarOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Variable tile offsets in their attribute files") + + public List> getTileVarOffsets() { + return tileVarOffsets; + } + + + public void setTileVarOffsets(List> tileVarOffsets) { + this.tileVarOffsets = tileVarOffsets; + } + + + public FragmentMetadata tileVarSizes(List> tileVarSizes) { + + this.tileVarSizes = tileVarSizes; + return this; + } + + public FragmentMetadata addTileVarSizesItem(List tileVarSizesItem) { + if (this.tileVarSizes == null) { + this.tileVarSizes = new ArrayList<>(); + } + this.tileVarSizes.add(tileVarSizesItem); + return this; + } + + /** + * The sizes of the uncompressed variable tiles + * @return tileVarSizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The sizes of the uncompressed variable tiles") + + public List> getTileVarSizes() { + return tileVarSizes; + } + + + public void setTileVarSizes(List> tileVarSizes) { + this.tileVarSizes = tileVarSizes; + } + + + public FragmentMetadata tileValidityOffsets(List> tileValidityOffsets) { + + this.tileValidityOffsets = tileValidityOffsets; + return this; + } + + public FragmentMetadata addTileValidityOffsetsItem(List tileValidityOffsetsItem) { + if (this.tileValidityOffsets == null) { + this.tileValidityOffsets = new ArrayList<>(); + } + this.tileValidityOffsets.add(tileValidityOffsetsItem); + return this; + } + + /** + * Validity tile offests in their attribute files + * @return tileValidityOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Validity tile offests in their attribute files") + + public List> getTileValidityOffsets() { + return tileValidityOffsets; + } + + + public void setTileValidityOffsets(List> tileValidityOffsets) { + this.tileValidityOffsets = tileValidityOffsets; + } + + + public FragmentMetadata tileMinBuffer(List> tileMinBuffer) { + + this.tileMinBuffer = tileMinBuffer; + return this; + } + + public FragmentMetadata addTileMinBufferItem(List tileMinBufferItem) { + if (this.tileMinBuffer == null) { + this.tileMinBuffer = new ArrayList<>(); + } + this.tileMinBuffer.add(tileMinBufferItem); + return this; + } + + /** + * tile min buffers + * @return tileMinBuffer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile min buffers") + + public List> getTileMinBuffer() { + return tileMinBuffer; + } + + + public void setTileMinBuffer(List> tileMinBuffer) { + this.tileMinBuffer = tileMinBuffer; + } + + + public FragmentMetadata tileMinVarBuffer(List> tileMinVarBuffer) { + + this.tileMinVarBuffer = tileMinVarBuffer; + return this; + } + + public FragmentMetadata addTileMinVarBufferItem(List tileMinVarBufferItem) { + if (this.tileMinVarBuffer == null) { + this.tileMinVarBuffer = new ArrayList<>(); + } + this.tileMinVarBuffer.add(tileMinVarBufferItem); + return this; + } + + /** + * tile min buffers for var length data + * @return tileMinVarBuffer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile min buffers for var length data") + + public List> getTileMinVarBuffer() { + return tileMinVarBuffer; + } + + + public void setTileMinVarBuffer(List> tileMinVarBuffer) { + this.tileMinVarBuffer = tileMinVarBuffer; + } + + + public FragmentMetadata tileMaxBuffer(List> tileMaxBuffer) { + + this.tileMaxBuffer = tileMaxBuffer; + return this; + } + + public FragmentMetadata addTileMaxBufferItem(List tileMaxBufferItem) { + if (this.tileMaxBuffer == null) { + this.tileMaxBuffer = new ArrayList<>(); + } + this.tileMaxBuffer.add(tileMaxBufferItem); + return this; + } + + /** + * tile max buffers + * @return tileMaxBuffer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile max buffers") + + public List> getTileMaxBuffer() { + return tileMaxBuffer; + } + + + public void setTileMaxBuffer(List> tileMaxBuffer) { + this.tileMaxBuffer = tileMaxBuffer; + } + + + public FragmentMetadata tileMaxVarBuffer(List> tileMaxVarBuffer) { + + this.tileMaxVarBuffer = tileMaxVarBuffer; + return this; + } + + public FragmentMetadata addTileMaxVarBufferItem(List tileMaxVarBufferItem) { + if (this.tileMaxVarBuffer == null) { + this.tileMaxVarBuffer = new ArrayList<>(); + } + this.tileMaxVarBuffer.add(tileMaxVarBufferItem); + return this; + } + + /** + * tile max buffers for var length data + * @return tileMaxVarBuffer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile max buffers for var length data") + + public List> getTileMaxVarBuffer() { + return tileMaxVarBuffer; + } + + + public void setTileMaxVarBuffer(List> tileMaxVarBuffer) { + this.tileMaxVarBuffer = tileMaxVarBuffer; + } + + + public FragmentMetadata tileSums(List> tileSums) { + + this.tileSums = tileSums; + return this; + } + + public FragmentMetadata addTileSumsItem(List tileSumsItem) { + if (this.tileSums == null) { + this.tileSums = new ArrayList<>(); + } + this.tileSums.add(tileSumsItem); + return this; + } + + /** + * tile sum values + * @return tileSums + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile sum values") + + public List> getTileSums() { + return tileSums; + } + + + public void setTileSums(List> tileSums) { + this.tileSums = tileSums; + } + + + public FragmentMetadata tileNullCounts(List> tileNullCounts) { + + this.tileNullCounts = tileNullCounts; + return this; + } + + public FragmentMetadata addTileNullCountsItem(List tileNullCountsItem) { + if (this.tileNullCounts == null) { + this.tileNullCounts = new ArrayList<>(); + } + this.tileNullCounts.add(tileNullCountsItem); + return this; + } + + /** + * tile null count values + * @return tileNullCounts + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile null count values") + + public List> getTileNullCounts() { + return tileNullCounts; + } + + + public void setTileNullCounts(List> tileNullCounts) { + this.tileNullCounts = tileNullCounts; + } + + + public FragmentMetadata fragmentMins(List> fragmentMins) { + + this.fragmentMins = fragmentMins; + return this; + } + + public FragmentMetadata addFragmentMinsItem(List fragmentMinsItem) { + if (this.fragmentMins == null) { + this.fragmentMins = new ArrayList<>(); + } + this.fragmentMins.add(fragmentMinsItem); + return this; + } + + /** + * fragment min values + * @return fragmentMins + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "fragment min values") + + public List> getFragmentMins() { + return fragmentMins; + } + + + public void setFragmentMins(List> fragmentMins) { + this.fragmentMins = fragmentMins; + } + + + public FragmentMetadata fragmentMaxs(List> fragmentMaxs) { + + this.fragmentMaxs = fragmentMaxs; + return this; + } + + public FragmentMetadata addFragmentMaxsItem(List fragmentMaxsItem) { + if (this.fragmentMaxs == null) { + this.fragmentMaxs = new ArrayList<>(); + } + this.fragmentMaxs.add(fragmentMaxsItem); + return this; + } + + /** + * fragment max values + * @return fragmentMaxs + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "fragment max values") + + public List> getFragmentMaxs() { + return fragmentMaxs; + } + + + public void setFragmentMaxs(List> fragmentMaxs) { + this.fragmentMaxs = fragmentMaxs; + } + + + public FragmentMetadata fragmentSums(List fragmentSums) { + + this.fragmentSums = fragmentSums; + return this; + } + + public FragmentMetadata addFragmentSumsItem(BigDecimal fragmentSumsItem) { + if (this.fragmentSums == null) { + this.fragmentSums = new ArrayList<>(); + } + this.fragmentSums.add(fragmentSumsItem); + return this; + } + + /** + * fragment sum values + * @return fragmentSums + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "fragment sum values") + + public List getFragmentSums() { + return fragmentSums; + } + + + public void setFragmentSums(List fragmentSums) { + this.fragmentSums = fragmentSums; + } + + + public FragmentMetadata fragmentNullCounts(List fragmentNullCounts) { + + this.fragmentNullCounts = fragmentNullCounts; + return this; + } + + public FragmentMetadata addFragmentNullCountsItem(BigDecimal fragmentNullCountsItem) { + if (this.fragmentNullCounts == null) { + this.fragmentNullCounts = new ArrayList<>(); + } + this.fragmentNullCounts.add(fragmentNullCountsItem); + return this; + } + + /** + * fragment null count values + * @return fragmentNullCounts + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "fragment null count values") + + public List getFragmentNullCounts() { + return fragmentNullCounts; + } + + + public void setFragmentNullCounts(List fragmentNullCounts) { + this.fragmentNullCounts = fragmentNullCounts; + } + + + public FragmentMetadata version(Integer version) { + + this.version = version; + return this; + } + + /** + * the format version of this metadata + * @return version + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the format version of this metadata") + + public Integer getVersion() { + return version; + } + + + public void setVersion(Integer version) { + this.version = version; + } + + + public FragmentMetadata timestampRange(List timestampRange) { + + this.timestampRange = timestampRange; + return this; + } + + public FragmentMetadata addTimestampRangeItem(BigDecimal timestampRangeItem) { + if (this.timestampRange == null) { + this.timestampRange = new ArrayList<>(); + } + this.timestampRange.add(timestampRangeItem); + return this; + } + + /** + * A pair of timestamps for fragment + * @return timestampRange + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A pair of timestamps for fragment") + + public List getTimestampRange() { + return timestampRange; + } + + + public void setTimestampRange(List timestampRange) { + this.timestampRange = timestampRange; + } + + + public FragmentMetadata lastTileCellNum(Integer lastTileCellNum) { + + this.lastTileCellNum = lastTileCellNum; + return this; + } + + /** + * The number of cells in the last tile + * @return lastTileCellNum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The number of cells in the last tile") + + public Integer getLastTileCellNum() { + return lastTileCellNum; + } + + + public void setLastTileCellNum(Integer lastTileCellNum) { + this.lastTileCellNum = lastTileCellNum; + } + + + public FragmentMetadata nonEmptyDomain(NonEmptyDomainList nonEmptyDomain) { + + this.nonEmptyDomain = nonEmptyDomain; + return this; + } + + /** + * Get nonEmptyDomain + * @return nonEmptyDomain + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public NonEmptyDomainList getNonEmptyDomain() { + return nonEmptyDomain; + } + + + public void setNonEmptyDomain(NonEmptyDomainList nonEmptyDomain) { + this.nonEmptyDomain = nonEmptyDomain; + } + + + public FragmentMetadata rtree(File rtree) { + + this.rtree = rtree; + return this; + } + + /** + * The RTree for the MBRs serialized as a blob + * @return rtree + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The RTree for the MBRs serialized as a blob") + + public File getRtree() { + return rtree; + } + + + public void setRtree(File rtree) { + this.rtree = rtree; + } + + + public FragmentMetadata hasConsolidatedFooter(Boolean hasConsolidatedFooter) { + + this.hasConsolidatedFooter = hasConsolidatedFooter; + return this; + } + + /** + * if the fragment metadata footer appears in a consolidated file + * @return hasConsolidatedFooter + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "if the fragment metadata footer appears in a consolidated file") + + public Boolean getHasConsolidatedFooter() { + return hasConsolidatedFooter; + } + + + public void setHasConsolidatedFooter(Boolean hasConsolidatedFooter) { + this.hasConsolidatedFooter = hasConsolidatedFooter; + } + + + public FragmentMetadata gtOffsets(GenericTileOffsets gtOffsets) { + + this.gtOffsets = gtOffsets; + return this; + } + + /** + * Get gtOffsets + * @return gtOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GenericTileOffsets getGtOffsets() { + return gtOffsets; + } + + + public void setGtOffsets(GenericTileOffsets gtOffsets) { + this.gtOffsets = gtOffsets; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public FragmentMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FragmentMetadata fragmentMetadata = (FragmentMetadata) o; + return Objects.equals(this.fileSizes, fragmentMetadata.fileSizes) && + Objects.equals(this.fileVarSizes, fragmentMetadata.fileVarSizes) && + Objects.equals(this.fileValiditySizes, fragmentMetadata.fileValiditySizes) && + Objects.equals(this.fragmentUri, fragmentMetadata.fragmentUri) && + Objects.equals(this.hasTimestamps, fragmentMetadata.hasTimestamps) && + Objects.equals(this.hasDeleteMeta, fragmentMetadata.hasDeleteMeta) && + Objects.equals(this.sparseTileNum, fragmentMetadata.sparseTileNum) && + Objects.equals(this.tileIndexBase, fragmentMetadata.tileIndexBase) && + Objects.equals(this.tileOffsets, fragmentMetadata.tileOffsets) && + Objects.equals(this.tileVarOffsets, fragmentMetadata.tileVarOffsets) && + Objects.equals(this.tileVarSizes, fragmentMetadata.tileVarSizes) && + Objects.equals(this.tileValidityOffsets, fragmentMetadata.tileValidityOffsets) && + Objects.equals(this.tileMinBuffer, fragmentMetadata.tileMinBuffer) && + Objects.equals(this.tileMinVarBuffer, fragmentMetadata.tileMinVarBuffer) && + Objects.equals(this.tileMaxBuffer, fragmentMetadata.tileMaxBuffer) && + Objects.equals(this.tileMaxVarBuffer, fragmentMetadata.tileMaxVarBuffer) && + Objects.equals(this.tileSums, fragmentMetadata.tileSums) && + Objects.equals(this.tileNullCounts, fragmentMetadata.tileNullCounts) && + Objects.equals(this.fragmentMins, fragmentMetadata.fragmentMins) && + Objects.equals(this.fragmentMaxs, fragmentMetadata.fragmentMaxs) && + Objects.equals(this.fragmentSums, fragmentMetadata.fragmentSums) && + Objects.equals(this.fragmentNullCounts, fragmentMetadata.fragmentNullCounts) && + Objects.equals(this.version, fragmentMetadata.version) && + Objects.equals(this.timestampRange, fragmentMetadata.timestampRange) && + Objects.equals(this.lastTileCellNum, fragmentMetadata.lastTileCellNum) && + Objects.equals(this.nonEmptyDomain, fragmentMetadata.nonEmptyDomain) && + Objects.equals(this.rtree, fragmentMetadata.rtree) && + Objects.equals(this.hasConsolidatedFooter, fragmentMetadata.hasConsolidatedFooter) && + Objects.equals(this.gtOffsets, fragmentMetadata.gtOffsets)&& + Objects.equals(this.additionalProperties, fragmentMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fileSizes, fileVarSizes, fileValiditySizes, fragmentUri, hasTimestamps, hasDeleteMeta, sparseTileNum, tileIndexBase, tileOffsets, tileVarOffsets, tileVarSizes, tileValidityOffsets, tileMinBuffer, tileMinVarBuffer, tileMaxBuffer, tileMaxVarBuffer, tileSums, tileNullCounts, fragmentMins, fragmentMaxs, fragmentSums, fragmentNullCounts, version, timestampRange, lastTileCellNum, nonEmptyDomain, rtree, hasConsolidatedFooter, gtOffsets, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FragmentMetadata {\n"); + sb.append(" fileSizes: ").append(toIndentedString(fileSizes)).append("\n"); + sb.append(" fileVarSizes: ").append(toIndentedString(fileVarSizes)).append("\n"); + sb.append(" fileValiditySizes: ").append(toIndentedString(fileValiditySizes)).append("\n"); + sb.append(" fragmentUri: ").append(toIndentedString(fragmentUri)).append("\n"); + sb.append(" hasTimestamps: ").append(toIndentedString(hasTimestamps)).append("\n"); + sb.append(" hasDeleteMeta: ").append(toIndentedString(hasDeleteMeta)).append("\n"); + sb.append(" sparseTileNum: ").append(toIndentedString(sparseTileNum)).append("\n"); + sb.append(" tileIndexBase: ").append(toIndentedString(tileIndexBase)).append("\n"); + sb.append(" tileOffsets: ").append(toIndentedString(tileOffsets)).append("\n"); + sb.append(" tileVarOffsets: ").append(toIndentedString(tileVarOffsets)).append("\n"); + sb.append(" tileVarSizes: ").append(toIndentedString(tileVarSizes)).append("\n"); + sb.append(" tileValidityOffsets: ").append(toIndentedString(tileValidityOffsets)).append("\n"); + sb.append(" tileMinBuffer: ").append(toIndentedString(tileMinBuffer)).append("\n"); + sb.append(" tileMinVarBuffer: ").append(toIndentedString(tileMinVarBuffer)).append("\n"); + sb.append(" tileMaxBuffer: ").append(toIndentedString(tileMaxBuffer)).append("\n"); + sb.append(" tileMaxVarBuffer: ").append(toIndentedString(tileMaxVarBuffer)).append("\n"); + sb.append(" tileSums: ").append(toIndentedString(tileSums)).append("\n"); + sb.append(" tileNullCounts: ").append(toIndentedString(tileNullCounts)).append("\n"); + sb.append(" fragmentMins: ").append(toIndentedString(fragmentMins)).append("\n"); + sb.append(" fragmentMaxs: ").append(toIndentedString(fragmentMaxs)).append("\n"); + sb.append(" fragmentSums: ").append(toIndentedString(fragmentSums)).append("\n"); + sb.append(" fragmentNullCounts: ").append(toIndentedString(fragmentNullCounts)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" timestampRange: ").append(toIndentedString(timestampRange)).append("\n"); + sb.append(" lastTileCellNum: ").append(toIndentedString(lastTileCellNum)).append("\n"); + sb.append(" nonEmptyDomain: ").append(toIndentedString(nonEmptyDomain)).append("\n"); + sb.append(" rtree: ").append(toIndentedString(rtree)).append("\n"); + sb.append(" hasConsolidatedFooter: ").append(toIndentedString(hasConsolidatedFooter)).append("\n"); + sb.append(" gtOffsets: ").append(toIndentedString(gtOffsets)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fileSizes"); + openapiFields.add("fileVarSizes"); + openapiFields.add("fileValiditySizes"); + openapiFields.add("fragmentUri"); + openapiFields.add("hasTimestamps"); + openapiFields.add("hasDeleteMeta"); + openapiFields.add("sparseTileNum"); + openapiFields.add("tileIndexBase"); + openapiFields.add("tileOffsets"); + openapiFields.add("tileVarOffsets"); + openapiFields.add("tileVarSizes"); + openapiFields.add("tileValidityOffsets"); + openapiFields.add("tileMinBuffer"); + openapiFields.add("tileMinVarBuffer"); + openapiFields.add("tileMaxBuffer"); + openapiFields.add("tileMaxVarBuffer"); + openapiFields.add("tileSums"); + openapiFields.add("tileNullCounts"); + openapiFields.add("fragmentMins"); + openapiFields.add("fragmentMaxs"); + openapiFields.add("fragmentSums"); + openapiFields.add("fragmentNullCounts"); + openapiFields.add("version"); + openapiFields.add("timestampRange"); + openapiFields.add("lastTileCellNum"); + openapiFields.add("nonEmptyDomain"); + openapiFields.add("rtree"); + openapiFields.add("hasConsolidatedFooter"); + openapiFields.add("gtOffsets"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FragmentMetadata + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FragmentMetadata.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FragmentMetadata is not found in the empty JSON string", FragmentMetadata.openapiRequiredFields.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("fileSizes") != null && !jsonObj.get("fileSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fileSizes` to be an array in the JSON string but got `%s`", jsonObj.get("fileSizes").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fileVarSizes") != null && !jsonObj.get("fileVarSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fileVarSizes` to be an array in the JSON string but got `%s`", jsonObj.get("fileVarSizes").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fileValiditySizes") != null && !jsonObj.get("fileValiditySizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fileValiditySizes` to be an array in the JSON string but got `%s`", jsonObj.get("fileValiditySizes").toString())); + } + if (jsonObj.get("fragmentUri") != null && !jsonObj.get("fragmentUri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fragmentUri").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileOffsets") != null && !jsonObj.get("tileOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileVarOffsets") != null && !jsonObj.get("tileVarOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileVarOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileVarOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileVarSizes") != null && !jsonObj.get("tileVarSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileVarSizes` to be an array in the JSON string but got `%s`", jsonObj.get("tileVarSizes").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileValidityOffsets") != null && !jsonObj.get("tileValidityOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileValidityOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileValidityOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileMinBuffer") != null && !jsonObj.get("tileMinBuffer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileMinBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMinBuffer").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileMinVarBuffer") != null && !jsonObj.get("tileMinVarBuffer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileMinVarBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMinVarBuffer").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileMaxBuffer") != null && !jsonObj.get("tileMaxBuffer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileMaxBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMaxBuffer").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileMaxVarBuffer") != null && !jsonObj.get("tileMaxVarBuffer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileMaxVarBuffer` to be an array in the JSON string but got `%s`", jsonObj.get("tileMaxVarBuffer").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileSums") != null && !jsonObj.get("tileSums").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileSums` to be an array in the JSON string but got `%s`", jsonObj.get("tileSums").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileNullCounts") != null && !jsonObj.get("tileNullCounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileNullCounts` to be an array in the JSON string but got `%s`", jsonObj.get("tileNullCounts").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fragmentMins") != null && !jsonObj.get("fragmentMins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentMins` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentMins").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fragmentMaxs") != null && !jsonObj.get("fragmentMaxs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentMaxs` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentMaxs").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fragmentSums") != null && !jsonObj.get("fragmentSums").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentSums` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentSums").toString())); + } + // ensure the json data is an array + if (jsonObj.get("fragmentNullCounts") != null && !jsonObj.get("fragmentNullCounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fragmentNullCounts` to be an array in the JSON string but got `%s`", jsonObj.get("fragmentNullCounts").toString())); + } + // ensure the json data is an array + if (jsonObj.get("timestampRange") != null && !jsonObj.get("timestampRange").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `timestampRange` to be an array in the JSON string but got `%s`", jsonObj.get("timestampRange").toString())); + } + // validate the optional field `nonEmptyDomain` + if (jsonObj.getAsJsonObject("nonEmptyDomain") != null) { + NonEmptyDomainList.validateJsonObject(jsonObj.getAsJsonObject("nonEmptyDomain")); + } + // validate the optional field `gtOffsets` + if (jsonObj.getAsJsonObject("gtOffsets") != null) { + GenericTileOffsets.validateJsonObject(jsonObj.getAsJsonObject("gtOffsets")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FragmentMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FragmentMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FragmentMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FragmentMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FragmentMetadata read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FragmentMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FragmentMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of FragmentMetadata + * @throws IOException if the JSON string is invalid with respect to FragmentMetadata + */ + public static FragmentMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FragmentMetadata.class); + } + + /** + * Convert an instance of FragmentMetadata 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/v2/model/GCPInteroperabilityCredential.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GCPInteroperabilityCredential.java new file mode 100644 index 0000000..97caf14 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GCPInteroperabilityCredential.java @@ -0,0 +1,298 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Credential information to access Google Cloud. using well knows key/secret pair to access storage. + */ +@ApiModel(description = "Credential information to access Google Cloud. using well knows key/secret pair to access storage.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GCPInteroperabilityCredential { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "secret_access_key"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + private String secretAccessKey; + + public GCPInteroperabilityCredential() { + } + + public GCPInteroperabilityCredential accessKeyId(String accessKeyId) { + + this.accessKeyId = accessKeyId; + return this; + } + + /** + * The ID of the access key + * @return accessKeyId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The ID of the access key") + + public String getAccessKeyId() { + return accessKeyId; + } + + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public GCPInteroperabilityCredential secretAccessKey(String secretAccessKey) { + + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * The access key's secret. Never returned in responses. + * @return secretAccessKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The access key's secret. Never returned in responses.") + + public String getSecretAccessKey() { + return secretAccessKey; + } + + + public void setSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GCPInteroperabilityCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, gcPInteroperabilityCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("access_key_id"); + openapiFields.add("secret_access_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GCPInteroperabilityCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GCPInteroperabilityCredential.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GCPInteroperabilityCredential is not found in the empty JSON string", GCPInteroperabilityCredential.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("access_key_id") != null && !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").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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GCPInteroperabilityCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GCPInteroperabilityCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/GCPServiceAccountKey.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GCPServiceAccountKey.java new file mode 100644 index 0000000..0f53d29 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GCPServiceAccountKey.java @@ -0,0 +1,331 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The key to a Google Cloud Platform service account. + */ +@ApiModel(description = "The key to a Google Cloud Platform service account.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GCPServiceAccountKey { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "account_id"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY_ID = "key_id"; + @SerializedName(SERIALIZED_NAME_KEY_ID) + private String keyId; + + public static final String SERIALIZED_NAME_KEY_TEXT = "key_text"; + @SerializedName(SERIALIZED_NAME_KEY_TEXT) + private String keyText; + + public GCPServiceAccountKey() { + } + + public GCPServiceAccountKey accountId(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.Nullable + @ApiModelProperty(example = "identity-data-reader@cinco-research.iam.gserviceaccount.com", value = "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. ") + + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GCPServiceAccountKey keyId(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.Nullable + @ApiModelProperty(example = "b85b7bac16fabf44fd9cd6885d4d1b444f07e9ab", value = "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. ") + + public String getKeyId() { + return keyId; + } + + + public void setKeyId(String keyId) { + this.keyId = keyId; + } + + + public GCPServiceAccountKey keyText(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.Nullable + @ApiModelProperty(example = "{ \"type\": \"service_account\", \"project_id\": \"cinco-research\", \"private_key_id\": \"b85b7bac16fabf44fd9cd6885d4d1b444f07e9ab\", \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n[lots of data goes here]\\n-----END PRIVATE KEY-----\\n\", \"client_email\": \"identity-data-reader@cinco-research.iam.gserviceaccount.com\", \"client_id\": \"105800434159734259879\", \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\", \"token_uri\": \"https://oauth2.googleapis.com/token\", \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\", \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/identity-data-reader%40cinco-research.iam.gserviceaccount.com\", \"universe_domain\": \"googleapis.com\" } ", value = "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). ") + + public String getKeyText() { + return keyText; + } + + + public void setKeyText(String keyText) { + this.keyText = keyText; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GCPServiceAccountKey putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, gcPServiceAccountKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, keyId, keyText, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("account_id"); + openapiFields.add("key_id"); + openapiFields.add("key_text"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GCPServiceAccountKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GCPServiceAccountKey.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GCPServiceAccountKey is not found in the empty JSON string", GCPServiceAccountKey.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("account_id") != null && !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") != null && !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") != null && !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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GCPServiceAccountKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GCPServiceAccountKey instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/GenericTileOffsets.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GenericTileOffsets.java new file mode 100644 index 0000000..06734f2 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GenericTileOffsets.java @@ -0,0 +1,661 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Array directory (for reads) + */ +@ApiModel(description = "Array directory (for reads)") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GenericTileOffsets { + public static final String SERIALIZED_NAME_RTREE = "rtree"; + @SerializedName(SERIALIZED_NAME_RTREE) + private BigDecimal rtree; + + public static final String SERIALIZED_NAME_TILE_OFFSETS = "tileOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_OFFSETS) + private List tileOffsets = null; + + public static final String SERIALIZED_NAME_TILE_VAR_OFFSETS = "tileVarOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_VAR_OFFSETS) + private List tileVarOffsets = null; + + public static final String SERIALIZED_NAME_TILE_VAR_SIZES = "tileVarSizes"; + @SerializedName(SERIALIZED_NAME_TILE_VAR_SIZES) + private List tileVarSizes = null; + + public static final String SERIALIZED_NAME_TILE_VALIDITY_OFFSETS = "tileValidityOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_VALIDITY_OFFSETS) + private List tileValidityOffsets = null; + + public static final String SERIALIZED_NAME_TILE_MIN_OFFSETS = "tileMinOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_MIN_OFFSETS) + private List tileMinOffsets = null; + + public static final String SERIALIZED_NAME_TILE_MAX_OFFSETS = "tileMaxOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_MAX_OFFSETS) + private List tileMaxOffsets = null; + + public static final String SERIALIZED_NAME_TILE_SUM_OFFSETS = "tileSumOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_SUM_OFFSETS) + private List tileSumOffsets = null; + + public static final String SERIALIZED_NAME_TILE_NULL_COUNT_OFFSETS = "tileNullCountOffsets"; + @SerializedName(SERIALIZED_NAME_TILE_NULL_COUNT_OFFSETS) + private List tileNullCountOffsets = null; + + public static final String SERIALIZED_NAME_FRAGMENT_MIN_MAX_SUM_NULL_COUNT_OFFSET = "fragmentMinMaxSumNullCountOffset"; + @SerializedName(SERIALIZED_NAME_FRAGMENT_MIN_MAX_SUM_NULL_COUNT_OFFSET) + private BigDecimal fragmentMinMaxSumNullCountOffset; + + public static final String SERIALIZED_NAME_PROCESSED_CONDITIONS_OFFSETS = "processedConditionsOffsets"; + @SerializedName(SERIALIZED_NAME_PROCESSED_CONDITIONS_OFFSETS) + private BigDecimal processedConditionsOffsets; + + public GenericTileOffsets() { + } + + public GenericTileOffsets rtree(BigDecimal rtree) { + + this.rtree = rtree; + return this; + } + + /** + * RTree serialized as a blob + * @return rtree + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "RTree serialized as a blob") + + public BigDecimal getRtree() { + return rtree; + } + + + public void setRtree(BigDecimal rtree) { + this.rtree = rtree; + } + + + public GenericTileOffsets tileOffsets(List tileOffsets) { + + this.tileOffsets = tileOffsets; + return this; + } + + public GenericTileOffsets addTileOffsetsItem(BigDecimal tileOffsetsItem) { + if (this.tileOffsets == null) { + this.tileOffsets = new ArrayList<>(); + } + this.tileOffsets.add(tileOffsetsItem); + return this; + } + + /** + * tile offsets + * @return tileOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile offsets") + + public List getTileOffsets() { + return tileOffsets; + } + + + public void setTileOffsets(List tileOffsets) { + this.tileOffsets = tileOffsets; + } + + + public GenericTileOffsets tileVarOffsets(List tileVarOffsets) { + + this.tileVarOffsets = tileVarOffsets; + return this; + } + + public GenericTileOffsets addTileVarOffsetsItem(BigDecimal tileVarOffsetsItem) { + if (this.tileVarOffsets == null) { + this.tileVarOffsets = new ArrayList<>(); + } + this.tileVarOffsets.add(tileVarOffsetsItem); + return this; + } + + /** + * variable tile offsets + * @return tileVarOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "variable tile offsets") + + public List getTileVarOffsets() { + return tileVarOffsets; + } + + + public void setTileVarOffsets(List tileVarOffsets) { + this.tileVarOffsets = tileVarOffsets; + } + + + public GenericTileOffsets tileVarSizes(List tileVarSizes) { + + this.tileVarSizes = tileVarSizes; + return this; + } + + public GenericTileOffsets addTileVarSizesItem(BigDecimal tileVarSizesItem) { + if (this.tileVarSizes == null) { + this.tileVarSizes = new ArrayList<>(); + } + this.tileVarSizes.add(tileVarSizesItem); + return this; + } + + /** + * sizes of the uncompressed variable tiles offsets + * @return tileVarSizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "sizes of the uncompressed variable tiles offsets") + + public List getTileVarSizes() { + return tileVarSizes; + } + + + public void setTileVarSizes(List tileVarSizes) { + this.tileVarSizes = tileVarSizes; + } + + + public GenericTileOffsets tileValidityOffsets(List tileValidityOffsets) { + + this.tileValidityOffsets = tileValidityOffsets; + return this; + } + + public GenericTileOffsets addTileValidityOffsetsItem(BigDecimal tileValidityOffsetsItem) { + if (this.tileValidityOffsets == null) { + this.tileValidityOffsets = new ArrayList<>(); + } + this.tileValidityOffsets.add(tileValidityOffsetsItem); + return this; + } + + /** + * tile validity offsets + * @return tileValidityOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile validity offsets") + + public List getTileValidityOffsets() { + return tileValidityOffsets; + } + + + public void setTileValidityOffsets(List tileValidityOffsets) { + this.tileValidityOffsets = tileValidityOffsets; + } + + + public GenericTileOffsets tileMinOffsets(List tileMinOffsets) { + + this.tileMinOffsets = tileMinOffsets; + return this; + } + + public GenericTileOffsets addTileMinOffsetsItem(BigDecimal tileMinOffsetsItem) { + if (this.tileMinOffsets == null) { + this.tileMinOffsets = new ArrayList<>(); + } + this.tileMinOffsets.add(tileMinOffsetsItem); + return this; + } + + /** + * min tile offsets + * @return tileMinOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "min tile offsets") + + public List getTileMinOffsets() { + return tileMinOffsets; + } + + + public void setTileMinOffsets(List tileMinOffsets) { + this.tileMinOffsets = tileMinOffsets; + } + + + public GenericTileOffsets tileMaxOffsets(List tileMaxOffsets) { + + this.tileMaxOffsets = tileMaxOffsets; + return this; + } + + public GenericTileOffsets addTileMaxOffsetsItem(BigDecimal tileMaxOffsetsItem) { + if (this.tileMaxOffsets == null) { + this.tileMaxOffsets = new ArrayList<>(); + } + this.tileMaxOffsets.add(tileMaxOffsetsItem); + return this; + } + + /** + * max tile offsets + * @return tileMaxOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "max tile offsets") + + public List getTileMaxOffsets() { + return tileMaxOffsets; + } + + + public void setTileMaxOffsets(List tileMaxOffsets) { + this.tileMaxOffsets = tileMaxOffsets; + } + + + public GenericTileOffsets tileSumOffsets(List tileSumOffsets) { + + this.tileSumOffsets = tileSumOffsets; + return this; + } + + public GenericTileOffsets addTileSumOffsetsItem(BigDecimal tileSumOffsetsItem) { + if (this.tileSumOffsets == null) { + this.tileSumOffsets = new ArrayList<>(); + } + this.tileSumOffsets.add(tileSumOffsetsItem); + return this; + } + + /** + * tile sum offsets + * @return tileSumOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "tile sum offsets") + + public List getTileSumOffsets() { + return tileSumOffsets; + } + + + public void setTileSumOffsets(List tileSumOffsets) { + this.tileSumOffsets = tileSumOffsets; + } + + + public GenericTileOffsets tileNullCountOffsets(List tileNullCountOffsets) { + + this.tileNullCountOffsets = tileNullCountOffsets; + return this; + } + + public GenericTileOffsets addTileNullCountOffsetsItem(BigDecimal tileNullCountOffsetsItem) { + if (this.tileNullCountOffsets == null) { + this.tileNullCountOffsets = new ArrayList<>(); + } + this.tileNullCountOffsets.add(tileNullCountOffsetsItem); + return this; + } + + /** + * null count offsets + * @return tileNullCountOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "null count offsets") + + public List getTileNullCountOffsets() { + return tileNullCountOffsets; + } + + + public void setTileNullCountOffsets(List tileNullCountOffsets) { + this.tileNullCountOffsets = tileNullCountOffsets; + } + + + public GenericTileOffsets fragmentMinMaxSumNullCountOffset(BigDecimal fragmentMinMaxSumNullCountOffset) { + + this.fragmentMinMaxSumNullCountOffset = fragmentMinMaxSumNullCountOffset; + return this; + } + + /** + * fragment min/max/sum/nullcount offsets + * @return fragmentMinMaxSumNullCountOffset + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "fragment min/max/sum/nullcount offsets") + + public BigDecimal getFragmentMinMaxSumNullCountOffset() { + return fragmentMinMaxSumNullCountOffset; + } + + + public void setFragmentMinMaxSumNullCountOffset(BigDecimal fragmentMinMaxSumNullCountOffset) { + this.fragmentMinMaxSumNullCountOffset = fragmentMinMaxSumNullCountOffset; + } + + + public GenericTileOffsets processedConditionsOffsets(BigDecimal processedConditionsOffsets) { + + this.processedConditionsOffsets = processedConditionsOffsets; + return this; + } + + /** + * processed conditions offsets + * @return processedConditionsOffsets + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "processed conditions offsets") + + public BigDecimal getProcessedConditionsOffsets() { + return processedConditionsOffsets; + } + + + public void setProcessedConditionsOffsets(BigDecimal processedConditionsOffsets) { + this.processedConditionsOffsets = processedConditionsOffsets; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GenericTileOffsets putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenericTileOffsets genericTileOffsets = (GenericTileOffsets) o; + return Objects.equals(this.rtree, genericTileOffsets.rtree) && + Objects.equals(this.tileOffsets, genericTileOffsets.tileOffsets) && + Objects.equals(this.tileVarOffsets, genericTileOffsets.tileVarOffsets) && + Objects.equals(this.tileVarSizes, genericTileOffsets.tileVarSizes) && + Objects.equals(this.tileValidityOffsets, genericTileOffsets.tileValidityOffsets) && + Objects.equals(this.tileMinOffsets, genericTileOffsets.tileMinOffsets) && + Objects.equals(this.tileMaxOffsets, genericTileOffsets.tileMaxOffsets) && + Objects.equals(this.tileSumOffsets, genericTileOffsets.tileSumOffsets) && + Objects.equals(this.tileNullCountOffsets, genericTileOffsets.tileNullCountOffsets) && + Objects.equals(this.fragmentMinMaxSumNullCountOffset, genericTileOffsets.fragmentMinMaxSumNullCountOffset) && + Objects.equals(this.processedConditionsOffsets, genericTileOffsets.processedConditionsOffsets)&& + Objects.equals(this.additionalProperties, genericTileOffsets.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rtree, tileOffsets, tileVarOffsets, tileVarSizes, tileValidityOffsets, tileMinOffsets, tileMaxOffsets, tileSumOffsets, tileNullCountOffsets, fragmentMinMaxSumNullCountOffset, processedConditionsOffsets, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenericTileOffsets {\n"); + sb.append(" rtree: ").append(toIndentedString(rtree)).append("\n"); + sb.append(" tileOffsets: ").append(toIndentedString(tileOffsets)).append("\n"); + sb.append(" tileVarOffsets: ").append(toIndentedString(tileVarOffsets)).append("\n"); + sb.append(" tileVarSizes: ").append(toIndentedString(tileVarSizes)).append("\n"); + sb.append(" tileValidityOffsets: ").append(toIndentedString(tileValidityOffsets)).append("\n"); + sb.append(" tileMinOffsets: ").append(toIndentedString(tileMinOffsets)).append("\n"); + sb.append(" tileMaxOffsets: ").append(toIndentedString(tileMaxOffsets)).append("\n"); + sb.append(" tileSumOffsets: ").append(toIndentedString(tileSumOffsets)).append("\n"); + sb.append(" tileNullCountOffsets: ").append(toIndentedString(tileNullCountOffsets)).append("\n"); + sb.append(" fragmentMinMaxSumNullCountOffset: ").append(toIndentedString(fragmentMinMaxSumNullCountOffset)).append("\n"); + sb.append(" processedConditionsOffsets: ").append(toIndentedString(processedConditionsOffsets)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rtree"); + openapiFields.add("tileOffsets"); + openapiFields.add("tileVarOffsets"); + openapiFields.add("tileVarSizes"); + openapiFields.add("tileValidityOffsets"); + openapiFields.add("tileMinOffsets"); + openapiFields.add("tileMaxOffsets"); + openapiFields.add("tileSumOffsets"); + openapiFields.add("tileNullCountOffsets"); + openapiFields.add("fragmentMinMaxSumNullCountOffset"); + openapiFields.add("processedConditionsOffsets"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenericTileOffsets + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GenericTileOffsets.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GenericTileOffsets is not found in the empty JSON string", GenericTileOffsets.openapiRequiredFields.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("tileOffsets") != null && !jsonObj.get("tileOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileVarOffsets") != null && !jsonObj.get("tileVarOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileVarOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileVarOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileVarSizes") != null && !jsonObj.get("tileVarSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileVarSizes` to be an array in the JSON string but got `%s`", jsonObj.get("tileVarSizes").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileValidityOffsets") != null && !jsonObj.get("tileValidityOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileValidityOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileValidityOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileMinOffsets") != null && !jsonObj.get("tileMinOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileMinOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileMinOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileMaxOffsets") != null && !jsonObj.get("tileMaxOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileMaxOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileMaxOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileSumOffsets") != null && !jsonObj.get("tileSumOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileSumOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileSumOffsets").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tileNullCountOffsets") != null && !jsonObj.get("tileNullCountOffsets").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tileNullCountOffsets` to be an array in the JSON string but got `%s`", jsonObj.get("tileNullCountOffsets").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenericTileOffsets.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenericTileOffsets' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenericTileOffsets.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenericTileOffsets value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GenericTileOffsets read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GenericTileOffsets instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenericTileOffsets given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenericTileOffsets + * @throws IOException if the JSON string is invalid with respect to GenericTileOffsets + */ + public static GenericTileOffsets fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenericTileOffsets.class); + } + + /** + * Convert an instance of GenericTileOffsets 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/v2/model/GroupActivityEventType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupActivityEventType.java new file mode 100644 index 0000000..bfeaddd --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupActivityEventType.java @@ -0,0 +1,99 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Event type of Group activity + */ +@JsonAdapter(GroupActivityEventType.Adapter.class) +public enum GroupActivityEventType { + + CREATE("create"), + + UPDATE("update"), + + DELETE("delete"), + + REGISTER("register"), + + DEREGISTER("deregister"), + + GROUP_MEMBER_ADD("group_member_add"), + + GROUP_MEMBER_GET("group_member_get"), + + GROUP_MEMBER_REMOVE("group_member_remove"), + + GROUP_METADATA_GET("group_metadata_get"), + + GROUP_METADATA_UPDATE("group_metadata_update"), + + GROUP_METADATA_DELETE("group_metadata_delete"), + + GROUP_METADATA_SERIALIZE("group_metadata_serialize"), + + GROUP_METADATA_DESERIALIZE("group_metadata_deserialize"), + + GROUP_METADATA_CONSOLIDATE("group_metadata_consolidate"), + + GROUP_METADATA_VACUUM("group_metadata_vacuum"), + + CONFIG_SET("config_set"), + + CONFIG_GET("config_get"); + + private String value; + + GroupActivityEventType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GroupActivityEventType fromValue(String value) { + for (GroupActivityEventType b : GroupActivityEventType.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 GroupActivityEventType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GroupActivityEventType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GroupActivityEventType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivity.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivity.java new file mode 100644 index 0000000..ae9af89 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivity.java @@ -0,0 +1,300 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Object containing activity of an asset of a group + */ +@ApiModel(description = "Object containing activity of an asset of a group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentActivity { + public static final String SERIALIZED_NAME_ASSET = "asset"; + @SerializedName(SERIALIZED_NAME_ASSET) + private GroupContentActivityAsset asset; + + public static final String SERIALIZED_NAME_ACTIVITY_LOG = "activity_log"; + @SerializedName(SERIALIZED_NAME_ACTIVITY_LOG) + private ArrayActivityLog activityLog; + + public GroupContentActivity() { + } + + public GroupContentActivity asset(GroupContentActivityAsset asset) { + + this.asset = asset; + return this; + } + + /** + * Get asset + * @return asset + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GroupContentActivityAsset getAsset() { + return asset; + } + + + public void setAsset(GroupContentActivityAsset asset) { + this.asset = asset; + } + + + public GroupContentActivity activityLog(ArrayActivityLog activityLog) { + + this.activityLog = activityLog; + return this; + } + + /** + * Get activityLog + * @return activityLog + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ArrayActivityLog getActivityLog() { + return activityLog; + } + + + public void setActivityLog(ArrayActivityLog activityLog) { + this.activityLog = activityLog; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentActivity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentActivity groupContentActivity = (GroupContentActivity) o; + return Objects.equals(this.asset, groupContentActivity.asset) && + Objects.equals(this.activityLog, groupContentActivity.activityLog)&& + Objects.equals(this.additionalProperties, groupContentActivity.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(asset, activityLog, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentActivity {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" activityLog: ").append(toIndentedString(activityLog)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("activity_log"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentActivity + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentActivity.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentActivity is not found in the empty JSON string", GroupContentActivity.openapiRequiredFields.toString())); + } + } + // validate the optional field `asset` + if (jsonObj.getAsJsonObject("asset") != null) { + GroupContentActivityAsset.validateJsonObject(jsonObj.getAsJsonObject("asset")); + } + // validate the optional field `activity_log` + if (jsonObj.getAsJsonObject("activity_log") != null) { + ArrayActivityLog.validateJsonObject(jsonObj.getAsJsonObject("activity_log")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentActivity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentActivity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentActivity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentActivity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentActivity read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentActivity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentActivity given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentActivity + * @throws IOException if the JSON string is invalid with respect to GroupContentActivity + */ + public static GroupContentActivity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentActivity.class); + } + + /** + * Convert an instance of GroupContentActivity 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/v2/model/GroupContentActivityAsset.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivityAsset.java new file mode 100644 index 0000000..2f0a85d --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivityAsset.java @@ -0,0 +1,361 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The asset details + */ +@ApiModel(description = "The asset details") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentActivityAsset { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace; + + public static final String SERIALIZED_NAME_ASSET_TYPE = "asset_type"; + @SerializedName(SERIALIZED_NAME_ASSET_TYPE) + private AssetType assetType; + + public GroupContentActivityAsset() { + } + + public GroupContentActivityAsset id(String id) { + + this.id = id; + return this; + } + + /** + * The asset ID + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The asset ID") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GroupContentActivityAsset name(String name) { + + this.name = name; + return this; + } + + /** + * The asset name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The asset name") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public GroupContentActivityAsset namespace(String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * The namespace that the asset belongs to + * @return namespace + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The namespace that the asset belongs to") + + public String getNamespace() { + return namespace; + } + + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + + public GroupContentActivityAsset assetType(AssetType assetType) { + + this.assetType = assetType; + return this; + } + + /** + * Get assetType + * @return assetType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AssetType getAssetType() { + return assetType; + } + + + public void setAssetType(AssetType assetType) { + this.assetType = assetType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentActivityAsset putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentActivityAsset groupContentActivityAsset = (GroupContentActivityAsset) o; + return Objects.equals(this.id, groupContentActivityAsset.id) && + Objects.equals(this.name, groupContentActivityAsset.name) && + Objects.equals(this.namespace, groupContentActivityAsset.namespace) && + Objects.equals(this.assetType, groupContentActivityAsset.assetType)&& + Objects.equals(this.additionalProperties, groupContentActivityAsset.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, namespace, assetType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentActivityAsset {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("namespace"); + openapiFields.add("asset_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentActivityAsset + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentActivityAsset.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentActivityAsset is not found in the empty JSON string", GroupContentActivityAsset.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("id") != null && !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").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("namespace") != null && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentActivityAsset.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentActivityAsset' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentActivityAsset.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentActivityAsset value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentActivityAsset read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentActivityAsset instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentActivityAsset given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentActivityAsset + * @throws IOException if the JSON string is invalid with respect to GroupContentActivityAsset + */ + public static GroupContentActivityAsset fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentActivityAsset.class); + } + + /** + * Convert an instance of GroupContentActivityAsset 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/v2/model/GroupContentActivityResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivityResponse.java new file mode 100644 index 0000000..f28f6e0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentActivityResponse.java @@ -0,0 +1,319 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Object containing activity logs of group content along with the pagination metadata + */ +@ApiModel(description = "Object containing activity logs of group content along with the pagination metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentActivityResponse { + public static final String SERIALIZED_NAME_ACTIVITY = "activity"; + @SerializedName(SERIALIZED_NAME_ACTIVITY) + private List activity = null; + + public static final String SERIALIZED_NAME_PAGINATION_METADATA = "pagination_metadata"; + @SerializedName(SERIALIZED_NAME_PAGINATION_METADATA) + private PaginationMetadata paginationMetadata; + + public GroupContentActivityResponse() { + } + + public GroupContentActivityResponse activity(List activity) { + + this.activity = activity; + return this; + } + + public GroupContentActivityResponse addActivityItem(GroupContentActivity activityItem) { + if (this.activity == null) { + this.activity = new ArrayList<>(); + } + this.activity.add(activityItem); + return this; + } + + /** + * Activity of a group's content + * @return activity + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Activity of a group's content") + + public List getActivity() { + return activity; + } + + + public void setActivity(List activity) { + this.activity = activity; + } + + + public GroupContentActivityResponse paginationMetadata(PaginationMetadata paginationMetadata) { + + this.paginationMetadata = paginationMetadata; + return this; + } + + /** + * Get paginationMetadata + * @return paginationMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaginationMetadata getPaginationMetadata() { + return paginationMetadata; + } + + + public void setPaginationMetadata(PaginationMetadata paginationMetadata) { + this.paginationMetadata = paginationMetadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentActivityResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentActivityResponse groupContentActivityResponse = (GroupContentActivityResponse) o; + return Objects.equals(this.activity, groupContentActivityResponse.activity) && + Objects.equals(this.paginationMetadata, groupContentActivityResponse.paginationMetadata)&& + Objects.equals(this.additionalProperties, groupContentActivityResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(activity, paginationMetadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentActivityResponse {\n"); + sb.append(" activity: ").append(toIndentedString(activity)).append("\n"); + sb.append(" paginationMetadata: ").append(toIndentedString(paginationMetadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activity"); + openapiFields.add("pagination_metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentActivityResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentActivityResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentActivityResponse is not found in the empty JSON string", GroupContentActivityResponse.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayactivity = jsonObj.getAsJsonArray("activity"); + if (jsonArrayactivity != null) { + // ensure the json data is an array + if (!jsonObj.get("activity").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `activity` to be an array in the JSON string but got `%s`", jsonObj.get("activity").toString())); + } + + // validate the optional field `activity` (array) + for (int i = 0; i < jsonArrayactivity.size(); i++) { + GroupContentActivity.validateJsonObject(jsonArrayactivity.get(i).getAsJsonObject()); + }; + } + // validate the optional field `pagination_metadata` + if (jsonObj.getAsJsonObject("pagination_metadata") != null) { + PaginationMetadata.validateJsonObject(jsonObj.getAsJsonObject("pagination_metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentActivityResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentActivityResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentActivityResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentActivityResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentActivityResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentActivityResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentActivityResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentActivityResponse + * @throws IOException if the JSON string is invalid with respect to GroupContentActivityResponse + */ + public static GroupContentActivityResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentActivityResponse.class); + } + + /** + * Convert an instance of GroupContentActivityResponse 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/v2/model/GroupContentsChangesRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsChangesRequest.java new file mode 100644 index 0000000..1b7e424 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsChangesRequest.java @@ -0,0 +1,300 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Updates the contents group + */ +@ApiModel(description = "Updates the contents group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentsChangesRequest { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public static final String SERIALIZED_NAME_GROUP_CHANGES = "group_changes"; + @SerializedName(SERIALIZED_NAME_GROUP_CHANGES) + private GroupContentsChangesRequestGroupChanges groupChanges; + + public GroupContentsChangesRequest() { + } + + public GroupContentsChangesRequest config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + + public GroupContentsChangesRequest groupChanges(GroupContentsChangesRequestGroupChanges groupChanges) { + + this.groupChanges = groupChanges; + return this; + } + + /** + * Get groupChanges + * @return groupChanges + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GroupContentsChangesRequestGroupChanges getGroupChanges() { + return groupChanges; + } + + + public void setGroupChanges(GroupContentsChangesRequestGroupChanges groupChanges) { + this.groupChanges = groupChanges; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentsChangesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentsChangesRequest groupContentsChangesRequest = (GroupContentsChangesRequest) o; + return Objects.equals(this.config, groupContentsChangesRequest.config) && + Objects.equals(this.groupChanges, groupContentsChangesRequest.groupChanges)&& + Objects.equals(this.additionalProperties, groupContentsChangesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, groupChanges, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentsChangesRequest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" groupChanges: ").append(toIndentedString(groupChanges)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("group_changes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentsChangesRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentsChangesRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentsChangesRequest is not found in the empty JSON string", GroupContentsChangesRequest.openapiRequiredFields.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + // validate the optional field `group_changes` + if (jsonObj.getAsJsonObject("group_changes") != null) { + GroupContentsChangesRequestGroupChanges.validateJsonObject(jsonObj.getAsJsonObject("group_changes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentsChangesRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentsChangesRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentsChangesRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentsChangesRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentsChangesRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentsChangesRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentsChangesRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentsChangesRequest + * @throws IOException if the JSON string is invalid with respect to GroupContentsChangesRequest + */ + public static GroupContentsChangesRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentsChangesRequest.class); + } + + /** + * Convert an instance of GroupContentsChangesRequest 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/v2/model/GroupContentsChangesRequestGroupChanges.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsChangesRequestGroupChanges.java new file mode 100644 index 0000000..3c24827 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsChangesRequestGroupChanges.java @@ -0,0 +1,325 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * GroupContentsChangesRequestGroupChanges + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentsChangesRequestGroupChanges { + public static final String SERIALIZED_NAME_MEMBERS_TO_REMOVE = "members_to_remove"; + @SerializedName(SERIALIZED_NAME_MEMBERS_TO_REMOVE) + private List membersToRemove = null; + + public static final String SERIALIZED_NAME_MEMBERS_TO_ADD = "members_to_add"; + @SerializedName(SERIALIZED_NAME_MEMBERS_TO_ADD) + private List membersToAdd = null; + + public GroupContentsChangesRequestGroupChanges() { + } + + public GroupContentsChangesRequestGroupChanges membersToRemove(List membersToRemove) { + + this.membersToRemove = membersToRemove; + return this; + } + + public GroupContentsChangesRequestGroupChanges addMembersToRemoveItem(String membersToRemoveItem) { + if (this.membersToRemove == null) { + this.membersToRemove = new ArrayList<>(); + } + this.membersToRemove.add(membersToRemoveItem); + return this; + } + + /** + * optional series of members to remove + * @return membersToRemove + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "optional series of members to remove") + + public List getMembersToRemove() { + return membersToRemove; + } + + + public void setMembersToRemove(List membersToRemove) { + this.membersToRemove = membersToRemove; + } + + + public GroupContentsChangesRequestGroupChanges membersToAdd(List membersToAdd) { + + this.membersToAdd = membersToAdd; + return this; + } + + public GroupContentsChangesRequestGroupChanges addMembersToAddItem(GroupMember membersToAddItem) { + if (this.membersToAdd == null) { + this.membersToAdd = new ArrayList<>(); + } + this.membersToAdd.add(membersToAddItem); + return this; + } + + /** + * optional series of members to add + * @return membersToAdd + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "optional series of members to add") + + public List getMembersToAdd() { + return membersToAdd; + } + + + public void setMembersToAdd(List membersToAdd) { + this.membersToAdd = membersToAdd; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentsChangesRequestGroupChanges putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentsChangesRequestGroupChanges groupContentsChangesRequestGroupChanges = (GroupContentsChangesRequestGroupChanges) o; + return Objects.equals(this.membersToRemove, groupContentsChangesRequestGroupChanges.membersToRemove) && + Objects.equals(this.membersToAdd, groupContentsChangesRequestGroupChanges.membersToAdd)&& + Objects.equals(this.additionalProperties, groupContentsChangesRequestGroupChanges.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(membersToRemove, membersToAdd, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentsChangesRequestGroupChanges {\n"); + sb.append(" membersToRemove: ").append(toIndentedString(membersToRemove)).append("\n"); + sb.append(" membersToAdd: ").append(toIndentedString(membersToAdd)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("members_to_remove"); + openapiFields.add("members_to_add"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentsChangesRequestGroupChanges + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentsChangesRequestGroupChanges.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentsChangesRequestGroupChanges is not found in the empty JSON string", GroupContentsChangesRequestGroupChanges.openapiRequiredFields.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("members_to_remove") != null && !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())); + } + JsonArray jsonArraymembersToAdd = jsonObj.getAsJsonArray("members_to_add"); + if (jsonArraymembersToAdd != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `members_to_add` (array) + for (int i = 0; i < jsonArraymembersToAdd.size(); i++) { + GroupMember.validateJsonObject(jsonArraymembersToAdd.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentsChangesRequestGroupChanges.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentsChangesRequestGroupChanges' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentsChangesRequestGroupChanges.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentsChangesRequestGroupChanges value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentsChangesRequestGroupChanges read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentsChangesRequestGroupChanges instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentsChangesRequestGroupChanges given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentsChangesRequestGroupChanges + * @throws IOException if the JSON string is invalid with respect to GroupContentsChangesRequestGroupChanges + */ + public static GroupContentsChangesRequestGroupChanges fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentsChangesRequestGroupChanges.class); + } + + /** + * Convert an instance of GroupContentsChangesRequestGroupChanges 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/v2/model/GroupContentsRetrievalRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsRetrievalRequest.java new file mode 100644 index 0000000..455cbfd --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsRetrievalRequest.java @@ -0,0 +1,266 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Request the contents of a group + */ +@ApiModel(description = "Request the contents of a group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentsRetrievalRequest { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public GroupContentsRetrievalRequest() { + } + + public GroupContentsRetrievalRequest config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentsRetrievalRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentsRetrievalRequest groupContentsRetrievalRequest = (GroupContentsRetrievalRequest) o; + return Objects.equals(this.config, groupContentsRetrievalRequest.config)&& + Objects.equals(this.additionalProperties, groupContentsRetrievalRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentsRetrievalRequest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentsRetrievalRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentsRetrievalRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentsRetrievalRequest is not found in the empty JSON string", GroupContentsRetrievalRequest.openapiRequiredFields.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentsRetrievalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentsRetrievalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentsRetrievalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentsRetrievalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentsRetrievalRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentsRetrievalRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentsRetrievalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentsRetrievalRequest + * @throws IOException if the JSON string is invalid with respect to GroupContentsRetrievalRequest + */ + public static GroupContentsRetrievalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentsRetrievalRequest.class); + } + + /** + * Convert an instance of GroupContentsRetrievalRequest 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/v2/model/GroupContentsRetrievalResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsRetrievalResponse.java new file mode 100644 index 0000000..99162be --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupContentsRetrievalResponse.java @@ -0,0 +1,319 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Object including a page of members of a group and pagination metadata + */ +@ApiModel(description = "Object including a page of members of a group and pagination metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupContentsRetrievalResponse { + public static final String SERIALIZED_NAME_MEMBERS = "members"; + @SerializedName(SERIALIZED_NAME_MEMBERS) + private List members = null; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata metadata; + + public GroupContentsRetrievalResponse() { + } + + public GroupContentsRetrievalResponse members(List members) { + + this.members = members; + return this; + } + + public GroupContentsRetrievalResponse addMembersItem(GroupMember membersItem) { + if (this.members == null) { + this.members = new ArrayList<>(); + } + this.members.add(membersItem); + return this; + } + + /** + * Groups members + * @return members + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Groups members") + + public List getMembers() { + return members; + } + + + public void setMembers(List members) { + this.members = members; + } + + + public GroupContentsRetrievalResponse metadata(Metadata metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Metadata getMetadata() { + return metadata; + } + + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupContentsRetrievalResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupContentsRetrievalResponse groupContentsRetrievalResponse = (GroupContentsRetrievalResponse) o; + return Objects.equals(this.members, groupContentsRetrievalResponse.members) && + Objects.equals(this.metadata, groupContentsRetrievalResponse.metadata)&& + Objects.equals(this.additionalProperties, groupContentsRetrievalResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(members, metadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupContentsRetrievalResponse {\n"); + sb.append(" members: ").append(toIndentedString(members)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("members"); + openapiFields.add("metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupContentsRetrievalResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupContentsRetrievalResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupContentsRetrievalResponse is not found in the empty JSON string", GroupContentsRetrievalResponse.openapiRequiredFields.toString())); + } + } + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + if (jsonArraymembers != null) { + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); + } + + // validate the optional field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + GroupMember.validateJsonObject(jsonArraymembers.get(i).getAsJsonObject()); + }; + } + // validate the optional field `metadata` + if (jsonObj.getAsJsonObject("metadata") != null) { + Metadata.validateJsonObject(jsonObj.getAsJsonObject("metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupContentsRetrievalResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupContentsRetrievalResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupContentsRetrievalResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupContentsRetrievalResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupContentsRetrievalResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupContentsRetrievalResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupContentsRetrievalResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupContentsRetrievalResponse + * @throws IOException if the JSON string is invalid with respect to GroupContentsRetrievalResponse + */ + public static GroupContentsRetrievalResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupContentsRetrievalResponse.class); + } + + /** + * Convert an instance of GroupContentsRetrievalResponse 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/v2/model/GroupCreationRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupCreationRequest.java new file mode 100644 index 0000000..a633f83 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupCreationRequest.java @@ -0,0 +1,308 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * information for creating a new group with the passed configuration + */ +@ApiModel(description = "information for creating a new group with the passed configuration") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupCreationRequest { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public static final String SERIALIZED_NAME_GROUP_DETAILS = "group_details"; + @SerializedName(SERIALIZED_NAME_GROUP_DETAILS) + private GroupCreationRequestGroupDetails groupDetails; + + public GroupCreationRequest() { + } + + public GroupCreationRequest config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + + public GroupCreationRequest groupDetails(GroupCreationRequestGroupDetails groupDetails) { + + this.groupDetails = groupDetails; + return this; + } + + /** + * Get groupDetails + * @return groupDetails + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public GroupCreationRequestGroupDetails getGroupDetails() { + return groupDetails; + } + + + public void setGroupDetails(GroupCreationRequestGroupDetails groupDetails) { + this.groupDetails = groupDetails; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupCreationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupCreationRequest groupCreationRequest = (GroupCreationRequest) o; + return Objects.equals(this.config, groupCreationRequest.config) && + Objects.equals(this.groupDetails, groupCreationRequest.groupDetails)&& + Objects.equals(this.additionalProperties, groupCreationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, groupDetails, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupCreationRequest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" groupDetails: ").append(toIndentedString(groupDetails)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("group_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("group_details"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupCreationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupCreationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupCreationRequest is not found in the empty JSON string", GroupCreationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupCreationRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + // validate the optional field `group_details` + if (jsonObj.getAsJsonObject("group_details") != null) { + GroupCreationRequestGroupDetails.validateJsonObject(jsonObj.getAsJsonObject("group_details")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupCreationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupCreationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupCreationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupCreationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupCreationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupCreationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupCreationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupCreationRequest + * @throws IOException if the JSON string is invalid with respect to GroupCreationRequest + */ + public static GroupCreationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupCreationRequest.class); + } + + /** + * Convert an instance of GroupCreationRequest 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/v2/model/GroupCreationRequestGroupDetails.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupCreationRequestGroupDetails.java new file mode 100644 index 0000000..4f16f04 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupCreationRequestGroupDetails.java @@ -0,0 +1,474 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Initial attributes for the creation of a group. + */ +@ApiModel(description = "Initial attributes for the creation of a group.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupCreationRequestGroupDetails { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_LOGO = "logo"; + @SerializedName(SERIALIZED_NAME_LOGO) + private String logo; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = null; + + public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; + @SerializedName(SERIALIZED_NAME_LICENSE_ID) + private String licenseId; + + public static final String SERIALIZED_NAME_LICENSE_TEXT = "license_text"; + @SerializedName(SERIALIZED_NAME_LICENSE_TEXT) + private String licenseText; + + public GroupCreationRequestGroupDetails() { + } + + public GroupCreationRequestGroupDetails description(String description) { + + this.description = description; + return this; + } + + /** + * A human readable description of the contents of the group. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A human readable description of the contents of the group.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public GroupCreationRequestGroupDetails name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the group. If must be unique within the group. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the group. If must be unique within the group.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public GroupCreationRequestGroupDetails uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * uri of group. + * @return uri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "uri of group.") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public GroupCreationRequestGroupDetails logo(String logo) { + + this.logo = logo; + return this; + } + + /** + * logo (base64 encoded) for the group. Optional + * @return logo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "logo (base64 encoded) for the group. Optional") + + public String getLogo() { + return logo; + } + + + public void setLogo(String logo) { + this.logo = logo; + } + + + public GroupCreationRequestGroupDetails tags(List tags) { + + this.tags = tags; + return this; + } + + public GroupCreationRequestGroupDetails addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * optional tags for groups. + * @return tags + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "optional tags for groups.") + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public GroupCreationRequestGroupDetails licenseId(String licenseId) { + + this.licenseId = licenseId; + return this; + } + + /** + * License identifier from SPDX License List or Custom. + * @return licenseId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "License identifier from SPDX License List or Custom.") + + public String getLicenseId() { + return licenseId; + } + + + public void setLicenseId(String licenseId) { + this.licenseId = licenseId; + } + + + public GroupCreationRequestGroupDetails licenseText(String licenseText) { + + this.licenseText = licenseText; + return this; + } + + /** + * License text + * @return licenseText + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "License text") + + public String getLicenseText() { + return licenseText; + } + + + public void setLicenseText(String licenseText) { + this.licenseText = licenseText; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupCreationRequestGroupDetails putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupCreationRequestGroupDetails groupCreationRequestGroupDetails = (GroupCreationRequestGroupDetails) o; + return Objects.equals(this.description, groupCreationRequestGroupDetails.description) && + Objects.equals(this.name, groupCreationRequestGroupDetails.name) && + Objects.equals(this.uri, groupCreationRequestGroupDetails.uri) && + Objects.equals(this.logo, groupCreationRequestGroupDetails.logo) && + Objects.equals(this.tags, groupCreationRequestGroupDetails.tags) && + Objects.equals(this.licenseId, groupCreationRequestGroupDetails.licenseId) && + Objects.equals(this.licenseText, groupCreationRequestGroupDetails.licenseText)&& + Objects.equals(this.additionalProperties, groupCreationRequestGroupDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, uri, logo, tags, licenseId, licenseText, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupCreationRequestGroupDetails {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); + sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("description"); + openapiFields.add("name"); + openapiFields.add("uri"); + openapiFields.add("logo"); + openapiFields.add("tags"); + openapiFields.add("license_id"); + openapiFields.add("license_text"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupCreationRequestGroupDetails + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupCreationRequestGroupDetails.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupCreationRequestGroupDetails is not found in the empty JSON string", GroupCreationRequestGroupDetails.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("description") != null && !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("name") != null && !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") != null && !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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); + } + if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupCreationRequestGroupDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupCreationRequestGroupDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupCreationRequestGroupDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupCreationRequestGroupDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupCreationRequestGroupDetails read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupCreationRequestGroupDetails instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupCreationRequestGroupDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupCreationRequestGroupDetails + * @throws IOException if the JSON string is invalid with respect to GroupCreationRequestGroupDetails + */ + public static GroupCreationRequestGroupDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupCreationRequestGroupDetails.class); + } + + /** + * Convert an instance of GroupCreationRequestGroupDetails 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/v2/model/GroupCreationResponse.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupCreationResponse.java new file mode 100644 index 0000000..8e588df --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupCreationResponse.java @@ -0,0 +1,331 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Information of the created group + */ +@ApiModel(description = "Information of the created group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupCreationResponse { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TILEDB_URI = "tiledb_uri"; + @SerializedName(SERIALIZED_NAME_TILEDB_URI) + private String tiledbUri; + + public GroupCreationResponse() { + } + + public GroupCreationResponse id(String id) { + + this.id = id; + return this; + } + + /** + * The UUID of the created Group + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The UUID of the created Group") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GroupCreationResponse name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the created Group + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the created Group") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public GroupCreationResponse tiledbUri(String tiledbUri) { + + this.tiledbUri = tiledbUri; + return this; + } + + /** + * TileDB URI for access + * @return tiledbUri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "TileDB URI for access") + + public String getTiledbUri() { + return tiledbUri; + } + + + public void setTiledbUri(String tiledbUri) { + this.tiledbUri = tiledbUri; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupCreationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupCreationResponse groupCreationResponse = (GroupCreationResponse) o; + return Objects.equals(this.id, groupCreationResponse.id) && + Objects.equals(this.name, groupCreationResponse.name) && + Objects.equals(this.tiledbUri, groupCreationResponse.tiledbUri)&& + Objects.equals(this.additionalProperties, groupCreationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, tiledbUri, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupCreationResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" tiledbUri: ").append(toIndentedString(tiledbUri)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("tiledb_uri"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupCreationResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupCreationResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupCreationResponse is not found in the empty JSON string", GroupCreationResponse.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("id") != null && !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").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("tiledb_uri") != null && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupCreationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupCreationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupCreationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupCreationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupCreationResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupCreationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupCreationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupCreationResponse + * @throws IOException if the JSON string is invalid with respect to GroupCreationResponse + */ + public static GroupCreationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupCreationResponse.class); + } + + /** + * Convert an instance of GroupCreationResponse 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/v2/model/GroupMember.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMember.java new file mode 100644 index 0000000..48b6ce6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMember.java @@ -0,0 +1,328 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * A groups member, array or another groups, to add or remove from an existing group. + */ +@ApiModel(description = "A groups member, array or another groups, to add or remove from an existing group.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupMember { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private GroupMemberType type; + + public GroupMember() { + } + + public GroupMember name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the member + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the member") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public GroupMember uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * The uri of the member + * @return uri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The uri of the member") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public GroupMember type(GroupMemberType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GroupMemberType getType() { + return type; + } + + + public void setType(GroupMemberType type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupMember putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupMember groupMember = (GroupMember) o; + return Objects.equals(this.name, groupMember.name) && + Objects.equals(this.uri, groupMember.uri) && + Objects.equals(this.type, groupMember.type)&& + Objects.equals(this.additionalProperties, groupMember.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, uri, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupMember {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("uri"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupMember + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupMember.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupMember is not found in the empty JSON string", GroupMember.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("name") != null && !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") != null && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupMember.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupMember' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupMember.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupMember value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupMember read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupMember instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupMember given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupMember + * @throws IOException if the JSON string is invalid with respect to GroupMember + */ + public static GroupMember fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupMember.class); + } + + /** + * Convert an instance of GroupMember 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/v2/model/GroupMemberAssetType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMemberAssetType.java new file mode 100644 index 0000000..137cdf6 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMemberAssetType.java @@ -0,0 +1,93 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Specific file types of group members + */ +@JsonAdapter(GroupMemberAssetType.Adapter.class) +public enum GroupMemberAssetType { + + GROUP("group"), + + ARRAY("array"), + + NOTEBOOK("notebook"), + + DASHBOARD("dashboard"), + + USER_DEFINED_FUNCTION("user_defined_function"), + + ML_MODEL("ml_model"), + + FILE("file"), + + BIOIMG("bioimg"), + + SOMA("soma"), + + VCF("vcf"), + + POINTCLOUD("pointcloud"), + + RASTER("raster"), + + GEOMETRY("geometry"), + + VECTOR_SEARCH("vector_search"); + + private String value; + + GroupMemberAssetType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GroupMemberAssetType fromValue(String value) { + for (GroupMemberAssetType b : GroupMemberAssetType.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 GroupMemberAssetType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GroupMemberAssetType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GroupMemberAssetType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMemberType.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMemberType.java new file mode 100644 index 0000000..f898f21 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMemberType.java @@ -0,0 +1,69 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * File types that can be included in groups + */ +@JsonAdapter(GroupMemberType.Adapter.class) +public enum GroupMemberType { + + GROUP("GROUP"), + + ARRAY("ARRAY"); + + private String value; + + GroupMemberType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GroupMemberType fromValue(String value) { + for (GroupMemberType b : GroupMemberType.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 GroupMemberType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GroupMemberType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GroupMemberType.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMetadataRetrievalRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMetadataRetrievalRequest.java new file mode 100644 index 0000000..028efa4 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMetadataRetrievalRequest.java @@ -0,0 +1,266 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Retrieves the metadata of a group + */ +@ApiModel(description = "Retrieves the metadata of a group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupMetadataRetrievalRequest { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public GroupMetadataRetrievalRequest() { + } + + public GroupMetadataRetrievalRequest config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupMetadataRetrievalRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupMetadataRetrievalRequest groupMetadataRetrievalRequest = (GroupMetadataRetrievalRequest) o; + return Objects.equals(this.config, groupMetadataRetrievalRequest.config)&& + Objects.equals(this.additionalProperties, groupMetadataRetrievalRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupMetadataRetrievalRequest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupMetadataRetrievalRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupMetadataRetrievalRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupMetadataRetrievalRequest is not found in the empty JSON string", GroupMetadataRetrievalRequest.openapiRequiredFields.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupMetadataRetrievalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupMetadataRetrievalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupMetadataRetrievalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupMetadataRetrievalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupMetadataRetrievalRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupMetadataRetrievalRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupMetadataRetrievalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupMetadataRetrievalRequest + * @throws IOException if the JSON string is invalid with respect to GroupMetadataRetrievalRequest + */ + public static GroupMetadataRetrievalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupMetadataRetrievalRequest.class); + } + + /** + * Convert an instance of GroupMetadataRetrievalRequest 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/v2/model/GroupMetadataUpdateRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMetadataUpdateRequest.java new file mode 100644 index 0000000..fde35e5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupMetadataUpdateRequest.java @@ -0,0 +1,308 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Updates the metadata of a group + */ +@ApiModel(description = "Updates the metadata of a group") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupMetadataUpdateRequest { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata metadata; + + public GroupMetadataUpdateRequest() { + } + + public GroupMetadataUpdateRequest config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + + public GroupMetadataUpdateRequest metadata(Metadata metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Metadata getMetadata() { + return metadata; + } + + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupMetadataUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupMetadataUpdateRequest groupMetadataUpdateRequest = (GroupMetadataUpdateRequest) o; + return Objects.equals(this.config, groupMetadataUpdateRequest.config) && + Objects.equals(this.metadata, groupMetadataUpdateRequest.metadata)&& + Objects.equals(this.additionalProperties, groupMetadataUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, metadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupMetadataUpdateRequest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("metadata"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupMetadataUpdateRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupMetadataUpdateRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupMetadataUpdateRequest is not found in the empty JSON string", GroupMetadataUpdateRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupMetadataUpdateRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + // validate the optional field `metadata` + if (jsonObj.getAsJsonObject("metadata") != null) { + Metadata.validateJsonObject(jsonObj.getAsJsonObject("metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupMetadataUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupMetadataUpdateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupMetadataUpdateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupMetadataUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupMetadataUpdateRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupMetadataUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupMetadataUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupMetadataUpdateRequest + * @throws IOException if the JSON string is invalid with respect to GroupMetadataUpdateRequest + */ + public static GroupMetadataUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupMetadataUpdateRequest.class); + } + + /** + * Convert an instance of GroupMetadataUpdateRequest 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/v2/model/GroupRegistrationRequest.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupRegistrationRequest.java new file mode 100644 index 0000000..f5c38b0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupRegistrationRequest.java @@ -0,0 +1,308 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * information for creating a new group with the passed configuration + */ +@ApiModel(description = "information for creating a new group with the passed configuration") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupRegistrationRequest { + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private TileDBConfig config; + + public static final String SERIALIZED_NAME_GROUP_DETAILS = "group_details"; + @SerializedName(SERIALIZED_NAME_GROUP_DETAILS) + private GroupRegistrationRequestGroupDetails groupDetails; + + public GroupRegistrationRequest() { + } + + public GroupRegistrationRequest config(TileDBConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * @return config + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TileDBConfig getConfig() { + return config; + } + + + public void setConfig(TileDBConfig config) { + this.config = config; + } + + + public GroupRegistrationRequest groupDetails(GroupRegistrationRequestGroupDetails groupDetails) { + + this.groupDetails = groupDetails; + return this; + } + + /** + * Get groupDetails + * @return groupDetails + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public GroupRegistrationRequestGroupDetails getGroupDetails() { + return groupDetails; + } + + + public void setGroupDetails(GroupRegistrationRequestGroupDetails groupDetails) { + this.groupDetails = groupDetails; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupRegistrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupRegistrationRequest groupRegistrationRequest = (GroupRegistrationRequest) o; + return Objects.equals(this.config, groupRegistrationRequest.config) && + Objects.equals(this.groupDetails, groupRegistrationRequest.groupDetails)&& + Objects.equals(this.additionalProperties, groupRegistrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(config, groupDetails, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupRegistrationRequest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" groupDetails: ").append(toIndentedString(groupDetails)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("config"); + openapiFields.add("group_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("group_details"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupRegistrationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupRegistrationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupRegistrationRequest is not found in the empty JSON string", GroupRegistrationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupRegistrationRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `config` + if (jsonObj.getAsJsonObject("config") != null) { + TileDBConfig.validateJsonObject(jsonObj.getAsJsonObject("config")); + } + // validate the optional field `group_details` + if (jsonObj.getAsJsonObject("group_details") != null) { + GroupRegistrationRequestGroupDetails.validateJsonObject(jsonObj.getAsJsonObject("group_details")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupRegistrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupRegistrationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupRegistrationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupRegistrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupRegistrationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupRegistrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupRegistrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupRegistrationRequest + * @throws IOException if the JSON string is invalid with respect to GroupRegistrationRequest + */ + public static GroupRegistrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupRegistrationRequest.class); + } + + /** + * Convert an instance of GroupRegistrationRequest 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/v2/model/GroupRegistrationRequestGroupDetails.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupRegistrationRequestGroupDetails.java new file mode 100644 index 0000000..e19ae5b --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/GroupRegistrationRequestGroupDetails.java @@ -0,0 +1,573 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Initial attributes for the creation of a group. + */ +@ApiModel(description = "Initial attributes for the creation of a group.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class GroupRegistrationRequestGroupDetails { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PARENT = "parent"; + @SerializedName(SERIALIZED_NAME_PARENT) + private String parent; + + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_LOGO = "logo"; + @SerializedName(SERIALIZED_NAME_LOGO) + private String logo; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = null; + + public static final String SERIALIZED_NAME_LICENSE_ID = "license_id"; + @SerializedName(SERIALIZED_NAME_LICENSE_ID) + private String licenseId; + + public static final String SERIALIZED_NAME_LICENSE_TEXT = "license_text"; + @SerializedName(SERIALIZED_NAME_LICENSE_TEXT) + private String licenseText; + + public static final String SERIALIZED_NAME_REGION = "region"; + @SerializedName(SERIALIZED_NAME_REGION) + private String region; + + public static final String SERIALIZED_NAME_ACCESS_CREDENTIALS_NAME = "access_credentials_name"; + @SerializedName(SERIALIZED_NAME_ACCESS_CREDENTIALS_NAME) + private String accessCredentialsName; + + public GroupRegistrationRequestGroupDetails() { + } + + public GroupRegistrationRequestGroupDetails description(String description) { + + this.description = description; + return this; + } + + /** + * A human readable description of the contents of the group. + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A human readable description of the contents of the group.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public GroupRegistrationRequestGroupDetails name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the group. If must be unique within the group. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the group. If must be unique within the group.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public GroupRegistrationRequestGroupDetails parent(String parent) { + + this.parent = parent; + return this; + } + + /** + * The unique name or id of the parent of the group. If empty, then the new group will be a top level group. + * @return parent + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The unique name or id of the parent of the group. If empty, then the new group will be a top level group.") + + public String getParent() { + return parent; + } + + + public void setParent(String parent) { + this.parent = parent; + } + + + public GroupRegistrationRequestGroupDetails uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * uri of group. + * @return uri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "uri of group.") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public GroupRegistrationRequestGroupDetails logo(String logo) { + + this.logo = logo; + return this; + } + + /** + * logo (base64 encoded) for the group. Optional + * @return logo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "logo (base64 encoded) for the group. Optional") + + public String getLogo() { + return logo; + } + + + public void setLogo(String logo) { + this.logo = logo; + } + + + public GroupRegistrationRequestGroupDetails tags(List tags) { + + this.tags = tags; + return this; + } + + public GroupRegistrationRequestGroupDetails addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * optional tags for groups. + * @return tags + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "optional tags for groups.") + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public GroupRegistrationRequestGroupDetails licenseId(String licenseId) { + + this.licenseId = licenseId; + return this; + } + + /** + * License identifier from SPDX License List or Custom. + * @return licenseId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "License identifier from SPDX License List or Custom.") + + public String getLicenseId() { + return licenseId; + } + + + public void setLicenseId(String licenseId) { + this.licenseId = licenseId; + } + + + public GroupRegistrationRequestGroupDetails licenseText(String licenseText) { + + this.licenseText = licenseText; + return this; + } + + /** + * License text + * @return licenseText + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "License text") + + public String getLicenseText() { + return licenseText; + } + + + public void setLicenseText(String licenseText) { + this.licenseText = licenseText; + } + + + public GroupRegistrationRequestGroupDetails region(String region) { + + this.region = region; + return this; + } + + /** + * region of the group + * @return region + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "region of the group") + + public String getRegion() { + return region; + } + + + public void setRegion(String region) { + this.region = region; + } + + + public GroupRegistrationRequestGroupDetails accessCredentialsName(String accessCredentialsName) { + + this.accessCredentialsName = accessCredentialsName; + return this; + } + + /** + * the name of the access credentials to use. if unset, the default credentials will be used. + * @return accessCredentialsName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the name of the access credentials to use. if unset, the default credentials will be used.") + + public String getAccessCredentialsName() { + return accessCredentialsName; + } + + + public void setAccessCredentialsName(String accessCredentialsName) { + this.accessCredentialsName = accessCredentialsName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public GroupRegistrationRequestGroupDetails putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupRegistrationRequestGroupDetails groupRegistrationRequestGroupDetails = (GroupRegistrationRequestGroupDetails) o; + return Objects.equals(this.description, groupRegistrationRequestGroupDetails.description) && + Objects.equals(this.name, groupRegistrationRequestGroupDetails.name) && + Objects.equals(this.parent, groupRegistrationRequestGroupDetails.parent) && + Objects.equals(this.uri, groupRegistrationRequestGroupDetails.uri) && + Objects.equals(this.logo, groupRegistrationRequestGroupDetails.logo) && + Objects.equals(this.tags, groupRegistrationRequestGroupDetails.tags) && + Objects.equals(this.licenseId, groupRegistrationRequestGroupDetails.licenseId) && + Objects.equals(this.licenseText, groupRegistrationRequestGroupDetails.licenseText) && + Objects.equals(this.region, groupRegistrationRequestGroupDetails.region) && + Objects.equals(this.accessCredentialsName, groupRegistrationRequestGroupDetails.accessCredentialsName)&& + Objects.equals(this.additionalProperties, groupRegistrationRequestGroupDetails.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, parent, uri, logo, tags, licenseId, licenseText, region, accessCredentialsName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupRegistrationRequestGroupDetails {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" licenseId: ").append(toIndentedString(licenseId)).append("\n"); + sb.append(" licenseText: ").append(toIndentedString(licenseText)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" accessCredentialsName: ").append(toIndentedString(accessCredentialsName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("description"); + openapiFields.add("name"); + openapiFields.add("parent"); + openapiFields.add("uri"); + openapiFields.add("logo"); + openapiFields.add("tags"); + openapiFields.add("license_id"); + openapiFields.add("license_text"); + openapiFields.add("region"); + openapiFields.add("access_credentials_name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupRegistrationRequestGroupDetails + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GroupRegistrationRequestGroupDetails.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GroupRegistrationRequestGroupDetails is not found in the empty JSON string", GroupRegistrationRequestGroupDetails.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("description") != null && !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("name") != null && !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("parent") != null && !jsonObj.get("parent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parent").toString())); + } + if (jsonObj.get("uri") != null && !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("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); + } + // ensure the json data is an array + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + if (jsonObj.get("license_id") != null && !jsonObj.get("license_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `license_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_id").toString())); + } + if (jsonObj.get("license_text") != null && !jsonObj.get("license_text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `license_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("license_text").toString())); + } + if (jsonObj.get("region") != null && !jsonObj.get("region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString())); + } + if (jsonObj.get("access_credentials_name") != null && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupRegistrationRequestGroupDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupRegistrationRequestGroupDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GroupRegistrationRequestGroupDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupRegistrationRequestGroupDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GroupRegistrationRequestGroupDetails read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + GroupRegistrationRequestGroupDetails instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GroupRegistrationRequestGroupDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupRegistrationRequestGroupDetails + * @throws IOException if the JSON string is invalid with respect to GroupRegistrationRequestGroupDetails + */ + public static GroupRegistrationRequestGroupDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupRegistrationRequestGroupDetails.class); + } + + /** + * Convert an instance of GroupRegistrationRequestGroupDetails 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/v2/model/Layout.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Layout.java new file mode 100644 index 0000000..9705aec --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Layout.java @@ -0,0 +1,73 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Layout of array + */ +@JsonAdapter(Layout.Adapter.class) +public enum Layout { + + ROW_MAJOR("row-major"), + + COL_MAJOR("col-major"), + + GLOBAL_ORDER("global-order"), + + UNORDERED("unordered"); + + private String value; + + Layout(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Layout fromValue(String value) { + for (Layout b : Layout.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 Layout enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Layout read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Layout.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/Metadata.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Metadata.java new file mode 100644 index 0000000..a02d8d5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Metadata.java @@ -0,0 +1,285 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * user's TileDB metadata + */ +@ApiModel(description = "user's TileDB metadata") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Metadata { + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + private List entries = null; + + public Metadata() { + } + + public Metadata entries(List entries) { + + this.entries = entries; + return this; + } + + public Metadata addEntriesItem(MetadataEntry entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * List of metadata entries + * @return entries + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of metadata entries") + + public List getEntries() { + return entries; + } + + + public void setEntries(List entries) { + this.entries = entries; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Metadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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.entries, metadata.entries)&& + Objects.equals(this.additionalProperties, metadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Metadata {\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("entries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Metadata + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Metadata.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Metadata is not found in the empty JSON string", Metadata.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + MetadataEntry.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); + }; + } + } + + 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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Metadata read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Metadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/MetadataEntry.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/MetadataEntry.java new file mode 100644 index 0000000..c300a81 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/MetadataEntry.java @@ -0,0 +1,388 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * key/value pair representing a group metadata map entry + */ +@ApiModel(description = "key/value pair representing a group metadata map entry") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class MetadataEntry { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_VALUE_NUM = "valueNum"; + @SerializedName(SERIALIZED_NAME_VALUE_NUM) + private Integer valueNum; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Object value; + + public static final String SERIALIZED_NAME_DEL = "del"; + @SerializedName(SERIALIZED_NAME_DEL) + private Boolean del; + + public MetadataEntry() { + } + + public MetadataEntry key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public MetadataEntry type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public MetadataEntry valueNum(Integer valueNum) { + + this.valueNum = valueNum; + return this; + } + + /** + * Get valueNum + * @return valueNum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getValueNum() { + return valueNum; + } + + + public void setValueNum(Integer valueNum) { + this.valueNum = valueNum; + } + + + public MetadataEntry value(Object value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Object getValue() { + return value; + } + + + public void setValue(Object value) { + this.value = value; + } + + + public MetadataEntry del(Boolean del) { + + this.del = del; + return this; + } + + /** + * Get del + * @return del + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getDel() { + return del; + } + + + public void setDel(Boolean del) { + this.del = del; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public MetadataEntry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataEntry metadataEntry = (MetadataEntry) o; + return Objects.equals(this.key, metadataEntry.key) && + Objects.equals(this.type, metadataEntry.type) && + Objects.equals(this.valueNum, metadataEntry.valueNum) && + Objects.equals(this.value, metadataEntry.value) && + Objects.equals(this.del, metadataEntry.del)&& + Objects.equals(this.additionalProperties, metadataEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, type, valueNum, value, del, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataEntry {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" valueNum: ").append(toIndentedString(valueNum)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" del: ").append(toIndentedString(del)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("type"); + openapiFields.add("valueNum"); + openapiFields.add("value"); + openapiFields.add("del"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MetadataEntry + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MetadataEntry.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MetadataEntry is not found in the empty JSON string", MetadataEntry.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("key") != null && !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("type") != null && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MetadataEntry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MetadataEntry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MetadataEntry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MetadataEntry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MetadataEntry read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + MetadataEntry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MetadataEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetadataEntry + * @throws IOException if the JSON string is invalid with respect to MetadataEntry + */ + public static MetadataEntry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MetadataEntry.class); + } + + /** + * Convert an instance of MetadataEntry 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/v2/model/NonEmptyDomain.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/NonEmptyDomain.java new file mode 100644 index 0000000..cb9a9a3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/NonEmptyDomain.java @@ -0,0 +1,349 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * object representing a non-empty domain + */ +@ApiModel(description = "object representing a non-empty domain") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class NonEmptyDomain { + public static final String SERIALIZED_NAME_NON_EMPTY_DOMAIN = "nonEmptyDomain"; + @SerializedName(SERIALIZED_NAME_NON_EMPTY_DOMAIN) + private DomainArray nonEmptyDomain; + + public static final String SERIALIZED_NAME_IS_EMPTY = "isEmpty"; + @SerializedName(SERIALIZED_NAME_IS_EMPTY) + private Boolean isEmpty; + + public static final String SERIALIZED_NAME_SIZES = "sizes"; + @SerializedName(SERIALIZED_NAME_SIZES) + private List sizes = null; + + public NonEmptyDomain() { + } + + public NonEmptyDomain nonEmptyDomain(DomainArray nonEmptyDomain) { + + this.nonEmptyDomain = nonEmptyDomain; + return this; + } + + /** + * Get nonEmptyDomain + * @return nonEmptyDomain + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public DomainArray getNonEmptyDomain() { + return nonEmptyDomain; + } + + + public void setNonEmptyDomain(DomainArray nonEmptyDomain) { + this.nonEmptyDomain = nonEmptyDomain; + } + + + public NonEmptyDomain isEmpty(Boolean isEmpty) { + + this.isEmpty = isEmpty; + return this; + } + + /** + * Is non-empty domain really empty? + * @return isEmpty + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "false", required = true, value = "Is non-empty domain really empty?") + + public Boolean getIsEmpty() { + return isEmpty; + } + + + public void setIsEmpty(Boolean isEmpty) { + this.isEmpty = isEmpty; + } + + + public NonEmptyDomain sizes(List sizes) { + + this.sizes = sizes; + return this; + } + + public NonEmptyDomain addSizesItem(Integer sizesItem) { + if (this.sizes == null) { + this.sizes = new ArrayList<>(); + } + this.sizes.add(sizesItem); + return this; + } + + /** + * Number of elements in DomainArray for var length + * @return sizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Number of elements in DomainArray for var length") + + public List getSizes() { + return sizes; + } + + + public void setSizes(List sizes) { + this.sizes = sizes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public NonEmptyDomain putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NonEmptyDomain nonEmptyDomain = (NonEmptyDomain) o; + return Objects.equals(this.nonEmptyDomain, nonEmptyDomain.nonEmptyDomain) && + Objects.equals(this.isEmpty, nonEmptyDomain.isEmpty) && + Objects.equals(this.sizes, nonEmptyDomain.sizes)&& + Objects.equals(this.additionalProperties, nonEmptyDomain.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nonEmptyDomain, isEmpty, sizes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NonEmptyDomain {\n"); + sb.append(" nonEmptyDomain: ").append(toIndentedString(nonEmptyDomain)).append("\n"); + sb.append(" isEmpty: ").append(toIndentedString(isEmpty)).append("\n"); + sb.append(" sizes: ").append(toIndentedString(sizes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nonEmptyDomain"); + openapiFields.add("isEmpty"); + openapiFields.add("sizes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nonEmptyDomain"); + openapiRequiredFields.add("isEmpty"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NonEmptyDomain + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NonEmptyDomain.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NonEmptyDomain is not found in the empty JSON string", NonEmptyDomain.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NonEmptyDomain.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `nonEmptyDomain` + if (jsonObj.getAsJsonObject("nonEmptyDomain") != null) { + DomainArray.validateJsonObject(jsonObj.getAsJsonObject("nonEmptyDomain")); + } + // ensure the json data is an array + if (jsonObj.get("sizes") != null && !jsonObj.get("sizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sizes` to be an array in the JSON string but got `%s`", jsonObj.get("sizes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NonEmptyDomain.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NonEmptyDomain' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NonEmptyDomain.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NonEmptyDomain value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public NonEmptyDomain read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + NonEmptyDomain instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NonEmptyDomain given an JSON string + * + * @param jsonString JSON string + * @return An instance of NonEmptyDomain + * @throws IOException if the JSON string is invalid with respect to NonEmptyDomain + */ + public static NonEmptyDomain fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NonEmptyDomain.class); + } + + /** + * Convert an instance of NonEmptyDomain 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/v2/model/NonEmptyDomainList.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/NonEmptyDomainList.java new file mode 100644 index 0000000..8217e81 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/NonEmptyDomainList.java @@ -0,0 +1,285 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * object containing non empty domains + */ +@ApiModel(description = "object containing non empty domains") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class NonEmptyDomainList { + public static final String SERIALIZED_NAME_NON_EMPTY_DOMAINS = "nonEmptyDomains"; + @SerializedName(SERIALIZED_NAME_NON_EMPTY_DOMAINS) + private List nonEmptyDomains = null; + + public NonEmptyDomainList() { + } + + public NonEmptyDomainList nonEmptyDomains(List nonEmptyDomains) { + + this.nonEmptyDomains = nonEmptyDomains; + return this; + } + + public NonEmptyDomainList addNonEmptyDomainsItem(NonEmptyDomain nonEmptyDomainsItem) { + if (this.nonEmptyDomains == null) { + this.nonEmptyDomains = new ArrayList<>(); + } + this.nonEmptyDomains.add(nonEmptyDomainsItem); + return this; + } + + /** + * Array's non empty domain + * @return nonEmptyDomains + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Array's non empty domain") + + public List getNonEmptyDomains() { + return nonEmptyDomains; + } + + + public void setNonEmptyDomains(List nonEmptyDomains) { + this.nonEmptyDomains = nonEmptyDomains; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public NonEmptyDomainList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NonEmptyDomainList nonEmptyDomainList = (NonEmptyDomainList) o; + return Objects.equals(this.nonEmptyDomains, nonEmptyDomainList.nonEmptyDomains)&& + Objects.equals(this.additionalProperties, nonEmptyDomainList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nonEmptyDomains, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NonEmptyDomainList {\n"); + sb.append(" nonEmptyDomains: ").append(toIndentedString(nonEmptyDomains)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nonEmptyDomains"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NonEmptyDomainList + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NonEmptyDomainList.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NonEmptyDomainList is not found in the empty JSON string", NonEmptyDomainList.openapiRequiredFields.toString())); + } + } + JsonArray jsonArraynonEmptyDomains = jsonObj.getAsJsonArray("nonEmptyDomains"); + if (jsonArraynonEmptyDomains != null) { + // ensure the json data is an array + if (!jsonObj.get("nonEmptyDomains").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nonEmptyDomains` to be an array in the JSON string but got `%s`", jsonObj.get("nonEmptyDomains").toString())); + } + + // validate the optional field `nonEmptyDomains` (array) + for (int i = 0; i < jsonArraynonEmptyDomains.size(); i++) { + NonEmptyDomain.validateJsonObject(jsonArraynonEmptyDomains.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NonEmptyDomainList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NonEmptyDomainList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NonEmptyDomainList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NonEmptyDomainList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public NonEmptyDomainList read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + NonEmptyDomainList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NonEmptyDomainList given an JSON string + * + * @param jsonString JSON string + * @return An instance of NonEmptyDomainList + * @throws IOException if the JSON string is invalid with respect to NonEmptyDomainList + */ + public static NonEmptyDomainList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NonEmptyDomainList.class); + } + + /** + * Convert an instance of NonEmptyDomainList 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/v2/model/NotebookUploaded.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/NotebookUploaded.java new file mode 100644 index 0000000..0a54cb0 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/NotebookUploaded.java @@ -0,0 +1,339 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Uploaded notebook name and information + */ +@ApiModel(description = "Uploaded notebook name and information") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class NotebookUploaded { + public static final String SERIALIZED_NAME_OUTPUT_URI = "output_uri"; + @SerializedName(SERIALIZED_NAME_OUTPUT_URI) + private String outputUri; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public NotebookUploaded() { + } + + public NotebookUploaded outputUri(String outputUri) { + + this.outputUri = outputUri; + return this; + } + + /** + * output location of the TileDB Notebook + * @return outputUri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "output location of the TileDB Notebook") + + public String getOutputUri() { + return outputUri; + } + + + public void setOutputUri(String outputUri) { + this.outputUri = outputUri; + } + + + public NotebookUploaded name(String name) { + + this.name = name; + return this; + } + + /** + * name of the notebook uploaded + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "name of the notebook uploaded") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public NotebookUploaded id(String id) { + + this.id = id; + return this; + } + + /** + * unique ID of the uploaded notebook + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "unique ID of the uploaded notebook") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public NotebookUploaded putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookUploaded notebookUploaded = (NotebookUploaded) o; + return Objects.equals(this.outputUri, notebookUploaded.outputUri) && + Objects.equals(this.name, notebookUploaded.name) && + Objects.equals(this.id, notebookUploaded.id)&& + Objects.equals(this.additionalProperties, notebookUploaded.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(outputUri, name, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookUploaded {\n"); + sb.append(" outputUri: ").append(toIndentedString(outputUri)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("output_uri"); + openapiFields.add("name"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NotebookUploaded + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NotebookUploaded.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NotebookUploaded is not found in the empty JSON string", NotebookUploaded.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NotebookUploaded.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("output_uri") != null && !jsonObj.get("output_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `output_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output_uri").toString())); + } + if (jsonObj.get("name") != null && !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").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 (!NotebookUploaded.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NotebookUploaded' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NotebookUploaded.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NotebookUploaded value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public NotebookUploaded read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + NotebookUploaded instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NotebookUploaded given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotebookUploaded + * @throws IOException if the JSON string is invalid with respect to NotebookUploaded + */ + public static NotebookUploaded fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NotebookUploaded.class); + } + + /** + * Convert an instance of NotebookUploaded 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/v2/model/PaginationMetadata.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/PaginationMetadata.java new file mode 100644 index 0000000..68e194e --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/PaginationMetadata.java @@ -0,0 +1,351 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * PaginationMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class PaginationMetadata { + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + private BigDecimal page; + + public static final String SERIALIZED_NAME_PER_PAGE = "per_page"; + @SerializedName(SERIALIZED_NAME_PER_PAGE) + private BigDecimal perPage; + + public static final String SERIALIZED_NAME_TOTAL_PAGES = "total_pages"; + @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) + private BigDecimal totalPages; + + public static final String SERIALIZED_NAME_TOTAL_ITEMS = "total_items"; + @SerializedName(SERIALIZED_NAME_TOTAL_ITEMS) + private BigDecimal totalItems; + + public PaginationMetadata() { + } + + public PaginationMetadata page(BigDecimal page) { + + this.page = page; + return this; + } + + /** + * pagination offset. Use it to skip the first ((page - 1) * per_page) items + * @return page + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1.0", value = "pagination offset. Use it to skip the first ((page - 1) * per_page) items") + + public BigDecimal getPage() { + return page; + } + + + public void setPage(BigDecimal page) { + this.page = page; + } + + + public PaginationMetadata perPage(BigDecimal perPage) { + + this.perPage = perPage; + return this; + } + + /** + * pagination limit (page size) + * @return perPage + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "10.0", value = "pagination limit (page size)") + + public BigDecimal getPerPage() { + return perPage; + } + + + public void setPerPage(BigDecimal perPage) { + this.perPage = perPage; + } + + + public PaginationMetadata totalPages(BigDecimal totalPages) { + + this.totalPages = totalPages; + return this; + } + + /** + * number of total pages with current limit + * @return totalPages + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "14.0", value = "number of total pages with current limit") + + public BigDecimal getTotalPages() { + return totalPages; + } + + + public void setTotalPages(BigDecimal totalPages) { + this.totalPages = totalPages; + } + + + public PaginationMetadata totalItems(BigDecimal totalItems) { + + this.totalItems = totalItems; + return this; + } + + /** + * number of total available items + * @return totalItems + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "138.0", value = "number of total available items") + + public BigDecimal getTotalItems() { + return totalItems; + } + + + public void setTotalItems(BigDecimal totalItems) { + this.totalItems = totalItems; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public PaginationMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @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)&& + Objects.equals(this.additionalProperties, paginationMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, perPage, totalPages, totalItems, additionalProperties); + } + + @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(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("page"); + openapiFields.add("per_page"); + openapiFields.add("total_pages"); + openapiFields.add("total_items"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaginationMetadata + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaginationMetadata.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaginationMetadata is not found in the empty JSON string", PaginationMetadata.openapiRequiredFields.toString())); + } + } + } + + 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(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PaginationMetadata read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + PaginationMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.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/v2/model/Query.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Query.java new file mode 100644 index 0000000..4423f9f --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Query.java @@ -0,0 +1,576 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Query + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Query { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Querytype type; + + public static final String SERIALIZED_NAME_LAYOUT = "layout"; + @SerializedName(SERIALIZED_NAME_LAYOUT) + private Layout layout; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Querystatus status; + + public static final String SERIALIZED_NAME_ATTRIBUTE_BUFFER_HEADERS = "attributeBufferHeaders"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTE_BUFFER_HEADERS) + private List attributeBufferHeaders = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WRITER = "writer"; + @SerializedName(SERIALIZED_NAME_WRITER) + private Writer writer; + + public static final String SERIALIZED_NAME_READER = "reader"; + @SerializedName(SERIALIZED_NAME_READER) + private QueryReader reader; + + public static final String SERIALIZED_NAME_ARRAY = "array"; + @SerializedName(SERIALIZED_NAME_ARRAY) + private Array array; + + public static final String SERIALIZED_NAME_TOTAL_FIXED_LENGTH_BUFFER_BYTES = "totalFixedLengthBufferBytes"; + @SerializedName(SERIALIZED_NAME_TOTAL_FIXED_LENGTH_BUFFER_BYTES) + private Integer totalFixedLengthBufferBytes; + + public static final String SERIALIZED_NAME_TOTAL_VAR_LEN_BUFFER_BYTES = "totalVarLenBufferBytes"; + @SerializedName(SERIALIZED_NAME_TOTAL_VAR_LEN_BUFFER_BYTES) + private Integer totalVarLenBufferBytes; + + public static final String SERIALIZED_NAME_TOTAL_VALIDITY_BUFFER_BYTES = "totalValidityBufferBytes"; + @SerializedName(SERIALIZED_NAME_TOTAL_VALIDITY_BUFFER_BYTES) + private Integer totalValidityBufferBytes; + + public Query() { + } + + public Query type(Querytype type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Querytype getType() { + return type; + } + + + public void setType(Querytype type) { + this.type = type; + } + + + public Query layout(Layout layout) { + + this.layout = layout; + return this; + } + + /** + * Get layout + * @return layout + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Layout getLayout() { + return layout; + } + + + public void setLayout(Layout layout) { + this.layout = layout; + } + + + public Query status(Querystatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Querystatus getStatus() { + return status; + } + + + public void setStatus(Querystatus status) { + this.status = status; + } + + + public Query attributeBufferHeaders(List attributeBufferHeaders) { + + this.attributeBufferHeaders = attributeBufferHeaders; + return this; + } + + public Query addAttributeBufferHeadersItem(AttributeBufferHeader attributeBufferHeadersItem) { + this.attributeBufferHeaders.add(attributeBufferHeadersItem); + return this; + } + + /** + * List of attribute buffer headers + * @return attributeBufferHeaders + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "List of attribute buffer headers") + + public List getAttributeBufferHeaders() { + return attributeBufferHeaders; + } + + + public void setAttributeBufferHeaders(List attributeBufferHeaders) { + this.attributeBufferHeaders = attributeBufferHeaders; + } + + + public Query writer(Writer writer) { + + this.writer = writer; + return this; + } + + /** + * Get writer + * @return writer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Writer getWriter() { + return writer; + } + + + public void setWriter(Writer writer) { + this.writer = writer; + } + + + public Query reader(QueryReader reader) { + + this.reader = reader; + return this; + } + + /** + * Get reader + * @return reader + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public QueryReader getReader() { + return reader; + } + + + public void setReader(QueryReader reader) { + this.reader = reader; + } + + + public Query array(Array array) { + + this.array = array; + return this; + } + + /** + * Get array + * @return array + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Array getArray() { + return array; + } + + + public void setArray(Array array) { + this.array = array; + } + + + public Query totalFixedLengthBufferBytes(Integer totalFixedLengthBufferBytes) { + + this.totalFixedLengthBufferBytes = totalFixedLengthBufferBytes; + return this; + } + + /** + * Total number of bytes in fixed size attribute buffers. + * @return totalFixedLengthBufferBytes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Total number of bytes in fixed size attribute buffers.") + + public Integer getTotalFixedLengthBufferBytes() { + return totalFixedLengthBufferBytes; + } + + + public void setTotalFixedLengthBufferBytes(Integer totalFixedLengthBufferBytes) { + this.totalFixedLengthBufferBytes = totalFixedLengthBufferBytes; + } + + + public Query totalVarLenBufferBytes(Integer totalVarLenBufferBytes) { + + this.totalVarLenBufferBytes = totalVarLenBufferBytes; + return this; + } + + /** + * Total number of bytes in variable size attribute buffers. + * @return totalVarLenBufferBytes + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Total number of bytes in variable size attribute buffers.") + + public Integer getTotalVarLenBufferBytes() { + return totalVarLenBufferBytes; + } + + + public void setTotalVarLenBufferBytes(Integer totalVarLenBufferBytes) { + this.totalVarLenBufferBytes = totalVarLenBufferBytes; + } + + + public Query totalValidityBufferBytes(Integer totalValidityBufferBytes) { + + this.totalValidityBufferBytes = totalValidityBufferBytes; + return this; + } + + /** + * Total number of bytes in validity buffers + * @return totalValidityBufferBytes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Total number of bytes in validity buffers") + + public Integer getTotalValidityBufferBytes() { + return totalValidityBufferBytes; + } + + + public void setTotalValidityBufferBytes(Integer totalValidityBufferBytes) { + this.totalValidityBufferBytes = totalValidityBufferBytes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Query putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Query query = (Query) o; + return Objects.equals(this.type, query.type) && + Objects.equals(this.layout, query.layout) && + Objects.equals(this.status, query.status) && + Objects.equals(this.attributeBufferHeaders, query.attributeBufferHeaders) && + Objects.equals(this.writer, query.writer) && + Objects.equals(this.reader, query.reader) && + Objects.equals(this.array, query.array) && + Objects.equals(this.totalFixedLengthBufferBytes, query.totalFixedLengthBufferBytes) && + Objects.equals(this.totalVarLenBufferBytes, query.totalVarLenBufferBytes) && + Objects.equals(this.totalValidityBufferBytes, query.totalValidityBufferBytes)&& + Objects.equals(this.additionalProperties, query.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, layout, status, attributeBufferHeaders, writer, reader, array, totalFixedLengthBufferBytes, totalVarLenBufferBytes, totalValidityBufferBytes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Query {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" attributeBufferHeaders: ").append(toIndentedString(attributeBufferHeaders)).append("\n"); + sb.append(" writer: ").append(toIndentedString(writer)).append("\n"); + sb.append(" reader: ").append(toIndentedString(reader)).append("\n"); + sb.append(" array: ").append(toIndentedString(array)).append("\n"); + sb.append(" totalFixedLengthBufferBytes: ").append(toIndentedString(totalFixedLengthBufferBytes)).append("\n"); + sb.append(" totalVarLenBufferBytes: ").append(toIndentedString(totalVarLenBufferBytes)).append("\n"); + sb.append(" totalValidityBufferBytes: ").append(toIndentedString(totalValidityBufferBytes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("layout"); + openapiFields.add("status"); + openapiFields.add("attributeBufferHeaders"); + openapiFields.add("writer"); + openapiFields.add("reader"); + openapiFields.add("array"); + openapiFields.add("totalFixedLengthBufferBytes"); + openapiFields.add("totalVarLenBufferBytes"); + openapiFields.add("totalValidityBufferBytes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("layout"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("attributeBufferHeaders"); + openapiRequiredFields.add("array"); + openapiRequiredFields.add("totalFixedLengthBufferBytes"); + openapiRequiredFields.add("totalVarLenBufferBytes"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Query.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Query is not found in the empty JSON string", Query.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Query.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + JsonArray jsonArrayattributeBufferHeaders = jsonObj.getAsJsonArray("attributeBufferHeaders"); + if (jsonArrayattributeBufferHeaders != null) { + // ensure the json data is an array + if (!jsonObj.get("attributeBufferHeaders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `attributeBufferHeaders` to be an array in the JSON string but got `%s`", jsonObj.get("attributeBufferHeaders").toString())); + } + + // validate the optional field `attributeBufferHeaders` (array) + for (int i = 0; i < jsonArrayattributeBufferHeaders.size(); i++) { + AttributeBufferHeader.validateJsonObject(jsonArrayattributeBufferHeaders.get(i).getAsJsonObject()); + }; + } + // validate the optional field `writer` + if (jsonObj.getAsJsonObject("writer") != null) { + Writer.validateJsonObject(jsonObj.getAsJsonObject("writer")); + } + // validate the optional field `reader` + if (jsonObj.getAsJsonObject("reader") != null) { + QueryReader.validateJsonObject(jsonObj.getAsJsonObject("reader")); + } + // validate the optional field `array` + if (jsonObj.getAsJsonObject("array") != null) { + Array.validateJsonObject(jsonObj.getAsJsonObject("array")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Query' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Query.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Query value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Query read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Query instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of Query + * @throws IOException if the JSON string is invalid with respect to Query + */ + public static Query fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Query.class); + } + + /** + * Convert an instance of Query 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/v2/model/QueryReader.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/QueryReader.java new file mode 100644 index 0000000..32f5603 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/QueryReader.java @@ -0,0 +1,330 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Read struct (can't be called reader due to class name conflict) + */ +@ApiModel(description = "Read struct (can't be called reader due to class name conflict)") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class QueryReader { + public static final String SERIALIZED_NAME_LAYOUT = "layout"; + @SerializedName(SERIALIZED_NAME_LAYOUT) + private Layout layout; + + public static final String SERIALIZED_NAME_SUBARRAY = "subarray"; + @SerializedName(SERIALIZED_NAME_SUBARRAY) + private Subarray subarray; + + public static final String SERIALIZED_NAME_READ_STATE = "readState"; + @SerializedName(SERIALIZED_NAME_READ_STATE) + private ReadState readState; + + public QueryReader() { + } + + public QueryReader layout(Layout layout) { + + this.layout = layout; + return this; + } + + /** + * Get layout + * @return layout + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Layout getLayout() { + return layout; + } + + + public void setLayout(Layout layout) { + this.layout = layout; + } + + + public QueryReader subarray(Subarray subarray) { + + this.subarray = subarray; + return this; + } + + /** + * Get subarray + * @return subarray + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Subarray getSubarray() { + return subarray; + } + + + public void setSubarray(Subarray subarray) { + this.subarray = subarray; + } + + + public QueryReader readState(ReadState readState) { + + this.readState = readState; + return this; + } + + /** + * Get readState + * @return readState + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ReadState getReadState() { + return readState; + } + + + public void setReadState(ReadState readState) { + this.readState = readState; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public QueryReader putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryReader queryReader = (QueryReader) o; + return Objects.equals(this.layout, queryReader.layout) && + Objects.equals(this.subarray, queryReader.subarray) && + Objects.equals(this.readState, queryReader.readState)&& + Objects.equals(this.additionalProperties, queryReader.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(layout, subarray, readState, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryReader {\n"); + sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); + sb.append(" subarray: ").append(toIndentedString(subarray)).append("\n"); + sb.append(" readState: ").append(toIndentedString(readState)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("layout"); + openapiFields.add("subarray"); + openapiFields.add("readState"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QueryReader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (QueryReader.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryReader is not found in the empty JSON string", QueryReader.openapiRequiredFields.toString())); + } + } + // validate the optional field `subarray` + if (jsonObj.getAsJsonObject("subarray") != null) { + Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + } + // validate the optional field `readState` + if (jsonObj.getAsJsonObject("readState") != null) { + ReadState.validateJsonObject(jsonObj.getAsJsonObject("readState")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryReader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryReader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryReader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryReader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QueryReader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + QueryReader instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryReader given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryReader + * @throws IOException if the JSON string is invalid with respect to QueryReader + */ + public static QueryReader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryReader.class); + } + + /** + * Convert an instance of QueryReader 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/v2/model/Querystatus.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Querystatus.java new file mode 100644 index 0000000..af0cabd --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Querystatus.java @@ -0,0 +1,75 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Status of query + */ +@JsonAdapter(Querystatus.Adapter.class) +public enum Querystatus { + + FAILED("FAILED"), + + COMPLETED("COMPLETED"), + + INPROGRESS("INPROGRESS"), + + INCOMPLETE("INCOMPLETE"), + + UNINITIALIZED("UNINITIALIZED"); + + private String value; + + Querystatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Querystatus fromValue(String value) { + for (Querystatus b : Querystatus.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 Querystatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Querystatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Querystatus.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/Querytype.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Querytype.java new file mode 100644 index 0000000..dddabf3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Querytype.java @@ -0,0 +1,69 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Type of query + */ +@JsonAdapter(Querytype.Adapter.class) +public enum Querytype { + + READ("READ"), + + WRITE("WRITE"); + + private String value; + + Querytype(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Querytype fromValue(String value) { + for (Querytype b : Querytype.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 Querytype enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Querytype read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Querytype.fromValue(value); + } + } +} + diff --git a/src/main/java/io/tiledb/cloud/rest_api/v2/model/ReadState.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ReadState.java new file mode 100644 index 0000000..98a52d5 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/ReadState.java @@ -0,0 +1,356 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * state for reads + */ +@ApiModel(description = "state for reads") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class ReadState { + public static final String SERIALIZED_NAME_INITIALIZED = "initialized"; + @SerializedName(SERIALIZED_NAME_INITIALIZED) + private Boolean initialized; + + public static final String SERIALIZED_NAME_OVERFLOWED = "overflowed"; + @SerializedName(SERIALIZED_NAME_OVERFLOWED) + private Boolean overflowed; + + public static final String SERIALIZED_NAME_UNSPLITTABLE = "unsplittable"; + @SerializedName(SERIALIZED_NAME_UNSPLITTABLE) + private Boolean unsplittable; + + public static final String SERIALIZED_NAME_SUBARRAY_PARTITIONER = "subarrayPartitioner"; + @SerializedName(SERIALIZED_NAME_SUBARRAY_PARTITIONER) + private SubarrayPartitioner subarrayPartitioner; + + public ReadState() { + } + + public ReadState initialized(Boolean initialized) { + + this.initialized = initialized; + return this; + } + + /** + * True if the reader has been initialized. + * @return initialized + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the reader has been initialized.") + + public Boolean getInitialized() { + return initialized; + } + + + public void setInitialized(Boolean initialized) { + this.initialized = initialized; + } + + + public ReadState overflowed(Boolean overflowed) { + + this.overflowed = overflowed; + return this; + } + + /** + * True if the query produced results that could not fit in some buffer. + * @return overflowed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the query produced results that could not fit in some buffer.") + + public Boolean getOverflowed() { + return overflowed; + } + + + public void setOverflowed(Boolean overflowed) { + this.overflowed = overflowed; + } + + + public ReadState unsplittable(Boolean unsplittable) { + + this.unsplittable = unsplittable; + return this; + } + + /** + * True if the current subarray partition is unsplittable. + * @return unsplittable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the current subarray partition is unsplittable.") + + public Boolean getUnsplittable() { + return unsplittable; + } + + + public void setUnsplittable(Boolean unsplittable) { + this.unsplittable = unsplittable; + } + + + public ReadState subarrayPartitioner(SubarrayPartitioner subarrayPartitioner) { + + this.subarrayPartitioner = subarrayPartitioner; + return this; + } + + /** + * Get subarrayPartitioner + * @return subarrayPartitioner + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public SubarrayPartitioner getSubarrayPartitioner() { + return subarrayPartitioner; + } + + + public void setSubarrayPartitioner(SubarrayPartitioner subarrayPartitioner) { + this.subarrayPartitioner = subarrayPartitioner; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ReadState putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadState readState = (ReadState) o; + return Objects.equals(this.initialized, readState.initialized) && + Objects.equals(this.overflowed, readState.overflowed) && + Objects.equals(this.unsplittable, readState.unsplittable) && + Objects.equals(this.subarrayPartitioner, readState.subarrayPartitioner)&& + Objects.equals(this.additionalProperties, readState.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(initialized, overflowed, unsplittable, subarrayPartitioner, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadState {\n"); + sb.append(" initialized: ").append(toIndentedString(initialized)).append("\n"); + sb.append(" overflowed: ").append(toIndentedString(overflowed)).append("\n"); + sb.append(" unsplittable: ").append(toIndentedString(unsplittable)).append("\n"); + sb.append(" subarrayPartitioner: ").append(toIndentedString(subarrayPartitioner)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("initialized"); + openapiFields.add("overflowed"); + openapiFields.add("unsplittable"); + openapiFields.add("subarrayPartitioner"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReadState + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReadState.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadState is not found in the empty JSON string", ReadState.openapiRequiredFields.toString())); + } + } + // validate the optional field `subarrayPartitioner` + if (jsonObj.getAsJsonObject("subarrayPartitioner") != null) { + SubarrayPartitioner.validateJsonObject(jsonObj.getAsJsonObject("subarrayPartitioner")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadState.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadState value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReadState read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ReadState instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReadState given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadState + * @throws IOException if the JSON string is invalid with respect to ReadState + */ + public static ReadState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadState.class); + } + + /** + * Convert an instance of ReadState 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/v2/model/Subarray.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Subarray.java new file mode 100644 index 0000000..0311585 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Subarray.java @@ -0,0 +1,315 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * A Subarray + */ +@ApiModel(description = "A Subarray") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Subarray { + public static final String SERIALIZED_NAME_LAYOUT = "layout"; + @SerializedName(SERIALIZED_NAME_LAYOUT) + private Layout layout; + + public static final String SERIALIZED_NAME_RANGES = "ranges"; + @SerializedName(SERIALIZED_NAME_RANGES) + private List ranges = null; + + public Subarray() { + } + + public Subarray layout(Layout layout) { + + this.layout = layout; + return this; + } + + /** + * Get layout + * @return layout + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Layout getLayout() { + return layout; + } + + + public void setLayout(Layout layout) { + this.layout = layout; + } + + + public Subarray ranges(List ranges) { + + this.ranges = ranges; + return this; + } + + public Subarray addRangesItem(SubarrayRanges rangesItem) { + if (this.ranges == null) { + this.ranges = new ArrayList<>(); + } + this.ranges.add(rangesItem); + return this; + } + + /** + * List of 1D ranges, one per dimension + * @return ranges + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of 1D ranges, one per dimension") + + public List getRanges() { + return ranges; + } + + + public void setRanges(List ranges) { + this.ranges = ranges; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Subarray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Subarray subarray = (Subarray) o; + return Objects.equals(this.layout, subarray.layout) && + Objects.equals(this.ranges, subarray.ranges)&& + Objects.equals(this.additionalProperties, subarray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(layout, ranges, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Subarray {\n"); + sb.append(" layout: ").append(toIndentedString(layout)).append("\n"); + sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("layout"); + openapiFields.add("ranges"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Subarray + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Subarray.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Subarray is not found in the empty JSON string", Subarray.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayranges = jsonObj.getAsJsonArray("ranges"); + if (jsonArrayranges != null) { + // ensure the json data is an array + if (!jsonObj.get("ranges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ranges` to be an array in the JSON string but got `%s`", jsonObj.get("ranges").toString())); + } + + // validate the optional field `ranges` (array) + for (int i = 0; i < jsonArrayranges.size(); i++) { + SubarrayRanges.validateJsonObject(jsonArrayranges.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Subarray.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Subarray' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Subarray.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Subarray value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Subarray read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Subarray instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Subarray given an JSON string + * + * @param jsonString JSON string + * @return An instance of Subarray + * @throws IOException if the JSON string is invalid with respect to Subarray + */ + public static Subarray fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Subarray.class); + } + + /** + * Convert an instance of Subarray 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/v2/model/SubarrayPartitioner.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayPartitioner.java new file mode 100644 index 0000000..321b38f --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayPartitioner.java @@ -0,0 +1,447 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The subarray partitioner + */ +@ApiModel(description = "The subarray partitioner") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class SubarrayPartitioner { + public static final String SERIALIZED_NAME_SUBARRAY = "subarray"; + @SerializedName(SERIALIZED_NAME_SUBARRAY) + private Subarray subarray; + + public static final String SERIALIZED_NAME_BUDGET = "budget"; + @SerializedName(SERIALIZED_NAME_BUDGET) + private List budget = null; + + public static final String SERIALIZED_NAME_CURRENT = "current"; + @SerializedName(SERIALIZED_NAME_CURRENT) + private SubarrayPartitionerCurrent current; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private SubarrayPartitionerState state; + + public static final String SERIALIZED_NAME_MEMORY_BUDGET = "memoryBudget"; + @SerializedName(SERIALIZED_NAME_MEMORY_BUDGET) + private Integer memoryBudget; + + public static final String SERIALIZED_NAME_MEMORY_BUDGET_VAR = "memoryBudgetVar"; + @SerializedName(SERIALIZED_NAME_MEMORY_BUDGET_VAR) + private Integer memoryBudgetVar; + + public SubarrayPartitioner() { + } + + public SubarrayPartitioner subarray(Subarray subarray) { + + this.subarray = subarray; + return this; + } + + /** + * Get subarray + * @return subarray + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Subarray getSubarray() { + return subarray; + } + + + public void setSubarray(Subarray subarray) { + this.subarray = subarray; + } + + + public SubarrayPartitioner budget(List budget) { + + this.budget = budget; + return this; + } + + public SubarrayPartitioner addBudgetItem(AttributeBufferSize budgetItem) { + if (this.budget == null) { + this.budget = new ArrayList<>(); + } + this.budget.add(budgetItem); + return this; + } + + /** + * Result size budget (in bytes) for all attributes. + * @return budget + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Result size budget (in bytes) for all attributes.") + + public List getBudget() { + return budget; + } + + + public void setBudget(List budget) { + this.budget = budget; + } + + + public SubarrayPartitioner current(SubarrayPartitionerCurrent current) { + + this.current = current; + return this; + } + + /** + * Get current + * @return current + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public SubarrayPartitionerCurrent getCurrent() { + return current; + } + + + public void setCurrent(SubarrayPartitionerCurrent current) { + this.current = current; + } + + + public SubarrayPartitioner state(SubarrayPartitionerState state) { + + this.state = state; + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public SubarrayPartitionerState getState() { + return state; + } + + + public void setState(SubarrayPartitionerState state) { + this.state = state; + } + + + public SubarrayPartitioner memoryBudget(Integer memoryBudget) { + + this.memoryBudget = memoryBudget; + return this; + } + + /** + * The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes + * @return memoryBudget + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The memory budget for the fixed-sized attributes and the offsets of the var-sized attributes") + + public Integer getMemoryBudget() { + return memoryBudget; + } + + + public void setMemoryBudget(Integer memoryBudget) { + this.memoryBudget = memoryBudget; + } + + + public SubarrayPartitioner memoryBudgetVar(Integer memoryBudgetVar) { + + this.memoryBudgetVar = memoryBudgetVar; + return this; + } + + /** + * The memory budget for the var-sized attributes + * @return memoryBudgetVar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The memory budget for the var-sized attributes") + + public Integer getMemoryBudgetVar() { + return memoryBudgetVar; + } + + + public void setMemoryBudgetVar(Integer memoryBudgetVar) { + this.memoryBudgetVar = memoryBudgetVar; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public SubarrayPartitioner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubarrayPartitioner subarrayPartitioner = (SubarrayPartitioner) o; + return Objects.equals(this.subarray, subarrayPartitioner.subarray) && + Objects.equals(this.budget, subarrayPartitioner.budget) && + Objects.equals(this.current, subarrayPartitioner.current) && + Objects.equals(this.state, subarrayPartitioner.state) && + Objects.equals(this.memoryBudget, subarrayPartitioner.memoryBudget) && + Objects.equals(this.memoryBudgetVar, subarrayPartitioner.memoryBudgetVar)&& + Objects.equals(this.additionalProperties, subarrayPartitioner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(subarray, budget, current, state, memoryBudget, memoryBudgetVar, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubarrayPartitioner {\n"); + sb.append(" subarray: ").append(toIndentedString(subarray)).append("\n"); + sb.append(" budget: ").append(toIndentedString(budget)).append("\n"); + sb.append(" current: ").append(toIndentedString(current)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" memoryBudget: ").append(toIndentedString(memoryBudget)).append("\n"); + sb.append(" memoryBudgetVar: ").append(toIndentedString(memoryBudgetVar)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subarray"); + openapiFields.add("budget"); + openapiFields.add("current"); + openapiFields.add("state"); + openapiFields.add("memoryBudget"); + openapiFields.add("memoryBudgetVar"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubarrayPartitioner + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SubarrayPartitioner.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayPartitioner is not found in the empty JSON string", SubarrayPartitioner.openapiRequiredFields.toString())); + } + } + // validate the optional field `subarray` + if (jsonObj.getAsJsonObject("subarray") != null) { + Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + } + JsonArray jsonArraybudget = jsonObj.getAsJsonArray("budget"); + if (jsonArraybudget != null) { + // ensure the json data is an array + if (!jsonObj.get("budget").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `budget` to be an array in the JSON string but got `%s`", jsonObj.get("budget").toString())); + } + + // validate the optional field `budget` (array) + for (int i = 0; i < jsonArraybudget.size(); i++) { + AttributeBufferSize.validateJsonObject(jsonArraybudget.get(i).getAsJsonObject()); + }; + } + // validate the optional field `current` + if (jsonObj.getAsJsonObject("current") != null) { + SubarrayPartitionerCurrent.validateJsonObject(jsonObj.getAsJsonObject("current")); + } + // validate the optional field `state` + if (jsonObj.getAsJsonObject("state") != null) { + SubarrayPartitionerState.validateJsonObject(jsonObj.getAsJsonObject("state")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubarrayPartitioner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubarrayPartitioner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubarrayPartitioner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubarrayPartitioner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SubarrayPartitioner read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SubarrayPartitioner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubarrayPartitioner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayPartitioner + * @throws IOException if the JSON string is invalid with respect to SubarrayPartitioner + */ + public static SubarrayPartitioner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubarrayPartitioner.class); + } + + /** + * Convert an instance of SubarrayPartitioner 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/v2/model/SubarrayPartitionerCurrent.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayPartitionerCurrent.java new file mode 100644 index 0000000..380d1af --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayPartitionerCurrent.java @@ -0,0 +1,356 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The current partition info + */ +@ApiModel(description = "The current partition info") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class SubarrayPartitionerCurrent { + public static final String SERIALIZED_NAME_SUBARRAY = "subarray"; + @SerializedName(SERIALIZED_NAME_SUBARRAY) + private Subarray subarray; + + public static final String SERIALIZED_NAME_START = "start"; + @SerializedName(SERIALIZED_NAME_START) + private Integer start; + + public static final String SERIALIZED_NAME_END = "end"; + @SerializedName(SERIALIZED_NAME_END) + private Integer end; + + public static final String SERIALIZED_NAME_SPLIT_MULTI_RANGE = "splitMultiRange"; + @SerializedName(SERIALIZED_NAME_SPLIT_MULTI_RANGE) + private Boolean splitMultiRange; + + public SubarrayPartitionerCurrent() { + } + + public SubarrayPartitionerCurrent subarray(Subarray subarray) { + + this.subarray = subarray; + return this; + } + + /** + * Get subarray + * @return subarray + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Subarray getSubarray() { + return subarray; + } + + + public void setSubarray(Subarray subarray) { + this.subarray = subarray; + } + + + public SubarrayPartitionerCurrent start(Integer start) { + + this.start = start; + return this; + } + + /** + * PartitionInfo start + * @return start + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "PartitionInfo start") + + public Integer getStart() { + return start; + } + + + public void setStart(Integer start) { + this.start = start; + } + + + public SubarrayPartitionerCurrent end(Integer end) { + + this.end = end; + return this; + } + + /** + * PartitionInfo end + * @return end + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "PartitionInfo end") + + public Integer getEnd() { + return end; + } + + + public void setEnd(Integer end) { + this.end = end; + } + + + public SubarrayPartitionerCurrent splitMultiRange(Boolean splitMultiRange) { + + this.splitMultiRange = splitMultiRange; + return this; + } + + /** + * PartitionInfo splitMultiRange + * @return splitMultiRange + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "PartitionInfo splitMultiRange") + + public Boolean getSplitMultiRange() { + return splitMultiRange; + } + + + public void setSplitMultiRange(Boolean splitMultiRange) { + this.splitMultiRange = splitMultiRange; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public SubarrayPartitionerCurrent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubarrayPartitionerCurrent subarrayPartitionerCurrent = (SubarrayPartitionerCurrent) o; + return Objects.equals(this.subarray, subarrayPartitionerCurrent.subarray) && + Objects.equals(this.start, subarrayPartitionerCurrent.start) && + Objects.equals(this.end, subarrayPartitionerCurrent.end) && + Objects.equals(this.splitMultiRange, subarrayPartitionerCurrent.splitMultiRange)&& + Objects.equals(this.additionalProperties, subarrayPartitionerCurrent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(subarray, start, end, splitMultiRange, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubarrayPartitionerCurrent {\n"); + sb.append(" subarray: ").append(toIndentedString(subarray)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" splitMultiRange: ").append(toIndentedString(splitMultiRange)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subarray"); + openapiFields.add("start"); + openapiFields.add("end"); + openapiFields.add("splitMultiRange"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubarrayPartitionerCurrent + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SubarrayPartitionerCurrent.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayPartitionerCurrent is not found in the empty JSON string", SubarrayPartitionerCurrent.openapiRequiredFields.toString())); + } + } + // validate the optional field `subarray` + if (jsonObj.getAsJsonObject("subarray") != null) { + Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubarrayPartitionerCurrent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubarrayPartitionerCurrent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubarrayPartitionerCurrent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubarrayPartitionerCurrent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SubarrayPartitionerCurrent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SubarrayPartitionerCurrent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubarrayPartitionerCurrent given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayPartitionerCurrent + * @throws IOException if the JSON string is invalid with respect to SubarrayPartitionerCurrent + */ + public static SubarrayPartitionerCurrent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubarrayPartitionerCurrent.class); + } + + /** + * Convert an instance of SubarrayPartitionerCurrent 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/v2/model/SubarrayPartitionerState.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayPartitionerState.java new file mode 100644 index 0000000..d6e4bf3 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayPartitionerState.java @@ -0,0 +1,395 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * The state information for the remaining partitions to be produced + */ +@ApiModel(description = "The state information for the remaining partitions to be produced") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class SubarrayPartitionerState { + public static final String SERIALIZED_NAME_START = "start"; + @SerializedName(SERIALIZED_NAME_START) + private Integer start; + + public static final String SERIALIZED_NAME_END = "end"; + @SerializedName(SERIALIZED_NAME_END) + private Integer end; + + public static final String SERIALIZED_NAME_SINGLE_RANGE = "singleRange"; + @SerializedName(SERIALIZED_NAME_SINGLE_RANGE) + private List singleRange = null; + + public static final String SERIALIZED_NAME_MULTI_RANGE = "multiRange"; + @SerializedName(SERIALIZED_NAME_MULTI_RANGE) + private List multiRange = null; + + public SubarrayPartitionerState() { + } + + public SubarrayPartitionerState start(Integer start) { + + this.start = start; + return this; + } + + /** + * State start + * @return start + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "State start") + + public Integer getStart() { + return start; + } + + + public void setStart(Integer start) { + this.start = start; + } + + + public SubarrayPartitionerState end(Integer end) { + + this.end = end; + return this; + } + + /** + * State end + * @return end + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "State end") + + public Integer getEnd() { + return end; + } + + + public void setEnd(Integer end) { + this.end = end; + } + + + public SubarrayPartitionerState singleRange(List singleRange) { + + this.singleRange = singleRange; + return this; + } + + public SubarrayPartitionerState addSingleRangeItem(Subarray singleRangeItem) { + if (this.singleRange == null) { + this.singleRange = new ArrayList<>(); + } + this.singleRange.add(singleRangeItem); + return this; + } + + /** + * State singleRange + * @return singleRange + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "State singleRange") + + public List getSingleRange() { + return singleRange; + } + + + public void setSingleRange(List singleRange) { + this.singleRange = singleRange; + } + + + public SubarrayPartitionerState multiRange(List multiRange) { + + this.multiRange = multiRange; + return this; + } + + public SubarrayPartitionerState addMultiRangeItem(Subarray multiRangeItem) { + if (this.multiRange == null) { + this.multiRange = new ArrayList<>(); + } + this.multiRange.add(multiRangeItem); + return this; + } + + /** + * State multiRange + * @return multiRange + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "State multiRange") + + public List getMultiRange() { + return multiRange; + } + + + public void setMultiRange(List multiRange) { + this.multiRange = multiRange; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public SubarrayPartitionerState putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubarrayPartitionerState subarrayPartitionerState = (SubarrayPartitionerState) o; + return Objects.equals(this.start, subarrayPartitionerState.start) && + Objects.equals(this.end, subarrayPartitionerState.end) && + Objects.equals(this.singleRange, subarrayPartitionerState.singleRange) && + Objects.equals(this.multiRange, subarrayPartitionerState.multiRange)&& + Objects.equals(this.additionalProperties, subarrayPartitionerState.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(start, end, singleRange, multiRange, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubarrayPartitionerState {\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" singleRange: ").append(toIndentedString(singleRange)).append("\n"); + sb.append(" multiRange: ").append(toIndentedString(multiRange)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("start"); + openapiFields.add("end"); + openapiFields.add("singleRange"); + openapiFields.add("multiRange"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubarrayPartitionerState + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SubarrayPartitionerState.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayPartitionerState is not found in the empty JSON string", SubarrayPartitionerState.openapiRequiredFields.toString())); + } + } + JsonArray jsonArraysingleRange = jsonObj.getAsJsonArray("singleRange"); + if (jsonArraysingleRange != null) { + // ensure the json data is an array + if (!jsonObj.get("singleRange").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `singleRange` to be an array in the JSON string but got `%s`", jsonObj.get("singleRange").toString())); + } + + // validate the optional field `singleRange` (array) + for (int i = 0; i < jsonArraysingleRange.size(); i++) { + Subarray.validateJsonObject(jsonArraysingleRange.get(i).getAsJsonObject()); + }; + } + JsonArray jsonArraymultiRange = jsonObj.getAsJsonArray("multiRange"); + if (jsonArraymultiRange != null) { + // ensure the json data is an array + if (!jsonObj.get("multiRange").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `multiRange` to be an array in the JSON string but got `%s`", jsonObj.get("multiRange").toString())); + } + + // validate the optional field `multiRange` (array) + for (int i = 0; i < jsonArraymultiRange.size(); i++) { + Subarray.validateJsonObject(jsonArraymultiRange.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubarrayPartitionerState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubarrayPartitionerState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubarrayPartitionerState.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubarrayPartitionerState value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SubarrayPartitionerState read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SubarrayPartitionerState instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubarrayPartitionerState given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayPartitionerState + * @throws IOException if the JSON string is invalid with respect to SubarrayPartitionerState + */ + public static SubarrayPartitionerState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubarrayPartitionerState.class); + } + + /** + * Convert an instance of SubarrayPartitionerState 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/v2/model/SubarrayRanges.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayRanges.java new file mode 100644 index 0000000..3fc8a66 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/SubarrayRanges.java @@ -0,0 +1,420 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * A set of 1D ranges for a subarray + */ +@ApiModel(description = "A set of 1D ranges for a subarray") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class SubarrayRanges { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Datatype type; + + public static final String SERIALIZED_NAME_HAS_DEFAULT_RANGE = "hasDefaultRange"; + @SerializedName(SERIALIZED_NAME_HAS_DEFAULT_RANGE) + private Boolean hasDefaultRange; + + public static final String SERIALIZED_NAME_BUFFER = "buffer"; + @SerializedName(SERIALIZED_NAME_BUFFER) + private List buffer = null; + + public static final String SERIALIZED_NAME_BUFFER_SIZES = "bufferSizes"; + @SerializedName(SERIALIZED_NAME_BUFFER_SIZES) + private List bufferSizes = null; + + public static final String SERIALIZED_NAME_BUFFER_START_SIZES = "bufferStartSizes"; + @SerializedName(SERIALIZED_NAME_BUFFER_START_SIZES) + private List bufferStartSizes = null; + + public SubarrayRanges() { + } + + public SubarrayRanges type(Datatype type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Datatype getType() { + return type; + } + + + public void setType(Datatype type) { + this.type = type; + } + + + public SubarrayRanges hasDefaultRange(Boolean hasDefaultRange) { + + this.hasDefaultRange = hasDefaultRange; + return this; + } + + /** + * True if the range is the default range + * @return hasDefaultRange + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "True if the range is the default range") + + public Boolean getHasDefaultRange() { + return hasDefaultRange; + } + + + public void setHasDefaultRange(Boolean hasDefaultRange) { + this.hasDefaultRange = hasDefaultRange; + } + + + public SubarrayRanges buffer(List buffer) { + + this.buffer = buffer; + return this; + } + + public SubarrayRanges addBufferItem(Integer bufferItem) { + if (this.buffer == null) { + this.buffer = new ArrayList<>(); + } + this.buffer.add(bufferItem); + return this; + } + + /** + * The bytes of the ranges + * @return buffer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The bytes of the ranges") + + public List getBuffer() { + return buffer; + } + + + public void setBuffer(List buffer) { + this.buffer = buffer; + } + + + public SubarrayRanges bufferSizes(List bufferSizes) { + + this.bufferSizes = bufferSizes; + return this; + } + + public SubarrayRanges addBufferSizesItem(Integer bufferSizesItem) { + if (this.bufferSizes == null) { + this.bufferSizes = new ArrayList<>(); + } + this.bufferSizes.add(bufferSizesItem); + return this; + } + + /** + * The list of sizes per range + * @return bufferSizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of sizes per range") + + public List getBufferSizes() { + return bufferSizes; + } + + + public void setBufferSizes(List bufferSizes) { + this.bufferSizes = bufferSizes; + } + + + public SubarrayRanges bufferStartSizes(List bufferStartSizes) { + + this.bufferStartSizes = bufferStartSizes; + return this; + } + + public SubarrayRanges addBufferStartSizesItem(Integer bufferStartSizesItem) { + if (this.bufferStartSizes == null) { + this.bufferStartSizes = new ArrayList<>(); + } + this.bufferStartSizes.add(bufferStartSizesItem); + return this; + } + + /** + * The list of start sizes per range + * @return bufferStartSizes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of start sizes per range") + + public List getBufferStartSizes() { + return bufferStartSizes; + } + + + public void setBufferStartSizes(List bufferStartSizes) { + this.bufferStartSizes = bufferStartSizes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public SubarrayRanges putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubarrayRanges subarrayRanges = (SubarrayRanges) o; + return Objects.equals(this.type, subarrayRanges.type) && + Objects.equals(this.hasDefaultRange, subarrayRanges.hasDefaultRange) && + Objects.equals(this.buffer, subarrayRanges.buffer) && + Objects.equals(this.bufferSizes, subarrayRanges.bufferSizes) && + Objects.equals(this.bufferStartSizes, subarrayRanges.bufferStartSizes)&& + Objects.equals(this.additionalProperties, subarrayRanges.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, hasDefaultRange, buffer, bufferSizes, bufferStartSizes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubarrayRanges {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" hasDefaultRange: ").append(toIndentedString(hasDefaultRange)).append("\n"); + sb.append(" buffer: ").append(toIndentedString(buffer)).append("\n"); + sb.append(" bufferSizes: ").append(toIndentedString(bufferSizes)).append("\n"); + sb.append(" bufferStartSizes: ").append(toIndentedString(bufferStartSizes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("hasDefaultRange"); + openapiFields.add("buffer"); + openapiFields.add("bufferSizes"); + openapiFields.add("bufferStartSizes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubarrayRanges + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SubarrayRanges.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SubarrayRanges is not found in the empty JSON string", SubarrayRanges.openapiRequiredFields.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("buffer") != null && !jsonObj.get("buffer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `buffer` to be an array in the JSON string but got `%s`", jsonObj.get("buffer").toString())); + } + // ensure the json data is an array + if (jsonObj.get("bufferSizes") != null && !jsonObj.get("bufferSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `bufferSizes` to be an array in the JSON string but got `%s`", jsonObj.get("bufferSizes").toString())); + } + // ensure the json data is an array + if (jsonObj.get("bufferStartSizes") != null && !jsonObj.get("bufferStartSizes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `bufferStartSizes` to be an array in the JSON string but got `%s`", jsonObj.get("bufferStartSizes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubarrayRanges.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubarrayRanges' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubarrayRanges.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubarrayRanges value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SubarrayRanges read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SubarrayRanges instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubarrayRanges given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubarrayRanges + * @throws IOException if the JSON string is invalid with respect to SubarrayRanges + */ + public static SubarrayRanges fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubarrayRanges.class); + } + + /** + * Convert an instance of SubarrayRanges 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/v2/model/TileDBConfig.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/TileDBConfig.java new file mode 100644 index 0000000..118ab4a --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/TileDBConfig.java @@ -0,0 +1,285 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * TileDB config used for interaction with the embedded library + */ +@ApiModel(description = "TileDB config used for interaction with the embedded library") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class TileDBConfig { + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + @SerializedName(SERIALIZED_NAME_ENTRIES) + private List entries = null; + + public TileDBConfig() { + } + + public TileDBConfig entries(List entries) { + + this.entries = entries; + return this; + } + + public TileDBConfig addEntriesItem(TileDBConfigEntriesInner entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * Get entries + * @return entries + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getEntries() { + return entries; + } + + + public void setEntries(List entries) { + this.entries = entries; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public TileDBConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TileDBConfig tileDBConfig = (TileDBConfig) o; + return Objects.equals(this.entries, tileDBConfig.entries)&& + Objects.equals(this.additionalProperties, tileDBConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TileDBConfig {\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("entries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TileDBConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TileDBConfig.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TileDBConfig is not found in the empty JSON string", TileDBConfig.openapiRequiredFields.toString())); + } + } + JsonArray jsonArrayentries = jsonObj.getAsJsonArray("entries"); + if (jsonArrayentries != null) { + // ensure the json data is an array + 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())); + } + + // validate the optional field `entries` (array) + for (int i = 0; i < jsonArrayentries.size(); i++) { + TileDBConfigEntriesInner.validateJsonObject(jsonArrayentries.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TileDBConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TileDBConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TileDBConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TileDBConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TileDBConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + TileDBConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TileDBConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of TileDBConfig + * @throws IOException if the JSON string is invalid with respect to TileDBConfig + */ + public static TileDBConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TileDBConfig.class); + } + + /** + * Convert an instance of TileDBConfig 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/v2/model/TileDBConfigEntriesInner.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/TileDBConfigEntriesInner.java new file mode 100644 index 0000000..1ec40fe --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/TileDBConfigEntriesInner.java @@ -0,0 +1,296 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * TileDBConfigEntriesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class TileDBConfigEntriesInner { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public TileDBConfigEntriesInner() { + } + + public TileDBConfigEntriesInner key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public TileDBConfigEntriesInner value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public TileDBConfigEntriesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TileDBConfigEntriesInner tileDBConfigEntriesInner = (TileDBConfigEntriesInner) o; + return Objects.equals(this.key, tileDBConfigEntriesInner.key) && + Objects.equals(this.value, tileDBConfigEntriesInner.value)&& + Objects.equals(this.additionalProperties, tileDBConfigEntriesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TileDBConfigEntriesInner {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TileDBConfigEntriesInner + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TileDBConfigEntriesInner.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TileDBConfigEntriesInner is not found in the empty JSON string", TileDBConfigEntriesInner.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("key") != null && !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") != null && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TileDBConfigEntriesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TileDBConfigEntriesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TileDBConfigEntriesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TileDBConfigEntriesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TileDBConfigEntriesInner read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + TileDBConfigEntriesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TileDBConfigEntriesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of TileDBConfigEntriesInner + * @throws IOException if the JSON string is invalid with respect to TileDBConfigEntriesInner + */ + public static TileDBConfigEntriesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TileDBConfigEntriesInner.class); + } + + /** + * Convert an instance of TileDBConfigEntriesInner 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/v2/model/TimestampedURI.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/TimestampedURI.java new file mode 100644 index 0000000..a41a168 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/TimestampedURI.java @@ -0,0 +1,326 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * the timestamped filtered array metadata URIs, after removing the ones that need to be vacuumed and those that do not fall within + */ +@ApiModel(description = "the timestamped filtered array metadata URIs, after removing the ones that need to be vacuumed and those that do not fall within") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class TimestampedURI { + public static final String SERIALIZED_NAME_URI = "uri"; + @SerializedName(SERIALIZED_NAME_URI) + private String uri; + + public static final String SERIALIZED_NAME_TIMESTAMP_START = "timestampStart"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP_START) + private BigDecimal timestampStart; + + public static final String SERIALIZED_NAME_TIMESTAMP_END = "timestampEnd"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP_END) + private BigDecimal timestampEnd; + + public TimestampedURI() { + } + + public TimestampedURI uri(String uri) { + + this.uri = uri; + return this; + } + + /** + * the uri + * @return uri + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "the uri") + + public String getUri() { + return uri; + } + + + public void setUri(String uri) { + this.uri = uri; + } + + + public TimestampedURI timestampStart(BigDecimal timestampStart) { + + this.timestampStart = timestampStart; + return this; + } + + /** + * start of timestamp + * @return timestampStart + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "start of timestamp") + + public BigDecimal getTimestampStart() { + return timestampStart; + } + + + public void setTimestampStart(BigDecimal timestampStart) { + this.timestampStart = timestampStart; + } + + + public TimestampedURI timestampEnd(BigDecimal timestampEnd) { + + this.timestampEnd = timestampEnd; + return this; + } + + /** + * end of timestamp + * @return timestampEnd + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "end of timestamp") + + public BigDecimal getTimestampEnd() { + return timestampEnd; + } + + + public void setTimestampEnd(BigDecimal timestampEnd) { + this.timestampEnd = timestampEnd; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public TimestampedURI putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimestampedURI timestampedURI = (TimestampedURI) o; + return Objects.equals(this.uri, timestampedURI.uri) && + Objects.equals(this.timestampStart, timestampedURI.timestampStart) && + Objects.equals(this.timestampEnd, timestampedURI.timestampEnd)&& + Objects.equals(this.additionalProperties, timestampedURI.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(uri, timestampStart, timestampEnd, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimestampedURI {\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" timestampStart: ").append(toIndentedString(timestampStart)).append("\n"); + sb.append(" timestampEnd: ").append(toIndentedString(timestampEnd)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uri"); + openapiFields.add("timestampStart"); + openapiFields.add("timestampEnd"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TimestampedURI + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TimestampedURI.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TimestampedURI is not found in the empty JSON string", TimestampedURI.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("uri") != null && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TimestampedURI.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TimestampedURI' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TimestampedURI.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TimestampedURI value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TimestampedURI read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + TimestampedURI instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TimestampedURI given an JSON string + * + * @param jsonString JSON string + * @return An instance of TimestampedURI + * @throws IOException if the JSON string is invalid with respect to TimestampedURI + */ + public static TimestampedURI fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TimestampedURI.class); + } + + /** + * Convert an instance of TimestampedURI 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/v2/model/Writer.java b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Writer.java new file mode 100644 index 0000000..d9b8d43 --- /dev/null +++ b/src/main/java/io/tiledb/cloud/rest_api/v2/model/Writer.java @@ -0,0 +1,388 @@ +/* + * Tiledb Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 1.4.0 + * + * + * 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.v2.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import io.tiledb.cloud.rest_api.v2.JSON; + +/** + * Writer + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-02T18:54:48.746612+03:00[Europe/Athens]") +public class Writer { + public static final String SERIALIZED_NAME_CHECK_COORD_DUPS = "checkCoordDups"; + @SerializedName(SERIALIZED_NAME_CHECK_COORD_DUPS) + private Boolean checkCoordDups; + + public static final String SERIALIZED_NAME_CHECK_COORD_O_O_B = "checkCoordOOB"; + @SerializedName(SERIALIZED_NAME_CHECK_COORD_O_O_B) + private Boolean checkCoordOOB; + + public static final String SERIALIZED_NAME_DEDUP_COORDS = "dedupCoords"; + @SerializedName(SERIALIZED_NAME_DEDUP_COORDS) + private Boolean dedupCoords; + + public static final String SERIALIZED_NAME_SUBARRAY_RANGES = "subarrayRanges"; + @SerializedName(SERIALIZED_NAME_SUBARRAY_RANGES) + private Subarray subarrayRanges; + + public static final String SERIALIZED_NAME_SUBARRAY = "subarray"; + @SerializedName(SERIALIZED_NAME_SUBARRAY) + private DomainArray subarray; + + public Writer() { + } + + public Writer checkCoordDups(Boolean checkCoordDups) { + + this.checkCoordDups = checkCoordDups; + return this; + } + + /** + * Get checkCoordDups + * @return checkCoordDups + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getCheckCoordDups() { + return checkCoordDups; + } + + + public void setCheckCoordDups(Boolean checkCoordDups) { + this.checkCoordDups = checkCoordDups; + } + + + public Writer checkCoordOOB(Boolean checkCoordOOB) { + + this.checkCoordOOB = checkCoordOOB; + return this; + } + + /** + * Get checkCoordOOB + * @return checkCoordOOB + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getCheckCoordOOB() { + return checkCoordOOB; + } + + + public void setCheckCoordOOB(Boolean checkCoordOOB) { + this.checkCoordOOB = checkCoordOOB; + } + + + public Writer dedupCoords(Boolean dedupCoords) { + + this.dedupCoords = dedupCoords; + return this; + } + + /** + * Get dedupCoords + * @return dedupCoords + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getDedupCoords() { + return dedupCoords; + } + + + public void setDedupCoords(Boolean dedupCoords) { + this.dedupCoords = dedupCoords; + } + + + public Writer subarrayRanges(Subarray subarrayRanges) { + + this.subarrayRanges = subarrayRanges; + return this; + } + + /** + * Get subarrayRanges + * @return subarrayRanges + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Subarray getSubarrayRanges() { + return subarrayRanges; + } + + + public void setSubarrayRanges(Subarray subarrayRanges) { + this.subarrayRanges = subarrayRanges; + } + + + public Writer subarray(DomainArray subarray) { + + this.subarray = subarray; + return this; + } + + /** + * Get subarray + * @return subarray + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public DomainArray getSubarray() { + return subarray; + } + + + public void setSubarray(DomainArray subarray) { + this.subarray = subarray; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public Writer putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Writer writer = (Writer) o; + return Objects.equals(this.checkCoordDups, writer.checkCoordDups) && + Objects.equals(this.checkCoordOOB, writer.checkCoordOOB) && + Objects.equals(this.dedupCoords, writer.dedupCoords) && + Objects.equals(this.subarrayRanges, writer.subarrayRanges) && + Objects.equals(this.subarray, writer.subarray)&& + Objects.equals(this.additionalProperties, writer.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(checkCoordDups, checkCoordOOB, dedupCoords, subarrayRanges, subarray, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Writer {\n"); + sb.append(" checkCoordDups: ").append(toIndentedString(checkCoordDups)).append("\n"); + sb.append(" checkCoordOOB: ").append(toIndentedString(checkCoordOOB)).append("\n"); + sb.append(" dedupCoords: ").append(toIndentedString(dedupCoords)).append("\n"); + sb.append(" subarrayRanges: ").append(toIndentedString(subarrayRanges)).append("\n"); + sb.append(" subarray: ").append(toIndentedString(subarray)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("checkCoordDups"); + openapiFields.add("checkCoordOOB"); + openapiFields.add("dedupCoords"); + openapiFields.add("subarrayRanges"); + openapiFields.add("subarray"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Writer + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Writer.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Writer is not found in the empty JSON string", Writer.openapiRequiredFields.toString())); + } + } + // validate the optional field `subarrayRanges` + if (jsonObj.getAsJsonObject("subarrayRanges") != null) { + Subarray.validateJsonObject(jsonObj.getAsJsonObject("subarrayRanges")); + } + // validate the optional field `subarray` + if (jsonObj.getAsJsonObject("subarray") != null) { + DomainArray.validateJsonObject(jsonObj.getAsJsonObject("subarray")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Writer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Writer' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Writer.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Writer value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Writer read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Writer instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Writer given an JSON string + * + * @param jsonString JSON string + * @return An instance of Writer + * @throws IOException if the JSON string is invalid with respect to Writer + */ + public static Writer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Writer.class); + } + + /** + * Convert an instance of Writer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/ArrayApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/ArrayApiTest.java new file mode 100644 index 0000000..e789dc0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/ArrayApiTest.java @@ -0,0 +1,586 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayActivityLog; +import io.tiledb.cloud.rest_api.model.ArrayBrowserData; +import io.tiledb.cloud.rest_api.model.ArrayBrowserSidebar; +import io.tiledb.cloud.rest_api.model.ArrayConsolidationRequest; +import io.tiledb.cloud.rest_api.model.ArrayEndTimestampData; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.ArrayInfoUpdate; +import io.tiledb.cloud.rest_api.model.ArrayMetadata; +import io.tiledb.cloud.rest_api.model.ArraySample; +import io.tiledb.cloud.rest_api.model.ArraySchema; +import io.tiledb.cloud.rest_api.model.ArraySharing; +import io.tiledb.cloud.rest_api.model.ArrayVacuumRequest; +import java.math.BigDecimal; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.FragmentInfo; +import io.tiledb.cloud.rest_api.model.FragmentInfoRequest; +import io.tiledb.cloud.rest_api.model.LastAccessedArray; +import io.tiledb.cloud.rest_api.model.LoadArraySchemaRequest; +import io.tiledb.cloud.rest_api.model.LoadArraySchemaResponse; +import io.tiledb.cloud.rest_api.model.LoadEnumerationsRequest; +import io.tiledb.cloud.rest_api.model.LoadEnumerationsResponse; +import io.tiledb.cloud.rest_api.model.MaxBufferSizes; +import io.tiledb.cloud.rest_api.model.NonEmptyDomain; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ArrayApi + */ +@Disabled +public class ArrayApiTest { + + private final ArrayApi api = new ArrayApi(); + + /** + * get array activity logs + * + * @throws ApiException if the Api call fails + */ + @Test + public void arrayActivityLogTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Integer start = null; + Integer end = null; + String eventTypes = null; + String taskId = null; + Boolean hasTaskId = null; + List response = api.arrayActivityLog(workspace, teamspace, array, start, end, eventTypes, taskId, hasTaskId); + // TODO: test validations + } + + /** + * Fetch a list of all arrays that are owned directly by user or user's organizations + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysBrowserOwnedGetTest() throws ApiException { + Integer page = null; + Integer perPage = null; + String search = null; + String namespace = null; + String orderby = null; + String permissions = null; + List tag = null; + List excludeTag = null; + List fileType = null; + List excludeFileType = null; + List fileProperty = null; + Boolean withMetadata = null; + ArrayBrowserData response = api.arraysBrowserOwnedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata); + // TODO: test validations + } + + /** + * Fetch a sidebar for arrays that are owned directly by user or user's organizations + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysBrowserOwnedSidebarGetTest() throws ApiException { + List fileType = null; + List excludeFileType = null; + List fileProperty = null; + ArrayBrowserSidebar response = api.arraysBrowserOwnedSidebarGet(fileType, excludeFileType, fileProperty); + // TODO: test validations + } + + /** + * Fetch a list of all arrays that have been shared publically + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysBrowserPublicGetTest() throws ApiException { + Integer page = null; + Integer perPage = null; + String search = null; + String namespace = null; + String orderby = null; + String permissions = null; + List tag = null; + List excludeTag = null; + List fileType = null; + List excludeFileType = null; + List fileProperty = null; + Boolean withMetadata = null; + ArrayBrowserData response = api.arraysBrowserPublicGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, withMetadata); + // TODO: test validations + } + + /** + * Fetch a sidebar of all arrays that have been shared publically + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysBrowserPublicSidebarGetTest() throws ApiException { + List fileType = null; + List excludeFileType = null; + List fileProperty = null; + ArrayBrowserSidebar response = api.arraysBrowserPublicSidebarGet(fileType, excludeFileType, fileProperty); + // TODO: test validations + } + + /** + * Fetch a list of all arrays that have been shared with the user + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysBrowserSharedGetTest() throws ApiException { + Integer page = null; + Integer perPage = null; + String search = null; + String namespace = null; + String orderby = null; + String permissions = null; + List tag = null; + List excludeTag = null; + List fileType = null; + List excludeFileType = null; + List fileProperty = null; + List sharedTo = null; + Boolean withMetadata = null; + ArrayBrowserData response = api.arraysBrowserSharedGet(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, fileType, excludeFileType, fileProperty, sharedTo, withMetadata); + // TODO: test validations + } + + /** + * Fetch a list of all arrays that have been shared with the user + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysBrowserSharedSidebarGetTest() throws ApiException { + List fileType = null; + List excludeFileType = null; + List fileProperty = null; + List sharedTo = null; + ArrayBrowserSidebar response = api.arraysBrowserSharedSidebarGet(fileType, excludeFileType, fileProperty, sharedTo); + // TODO: test validations + } + + /** + * retrieve a list of timestamps from the array fragment info listing in milliseconds, paginated + * + * @throws ApiException if the Api call fails + */ + @Test + public void arraysWorkspaceTeamspaceArrayEndTimestampsGetTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Integer page = null; + Integer perPage = null; + ArrayEndTimestampData response = api.arraysWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage); + // TODO: test validations + } + + /** + * consolidate an array at a specified URI + * + * @throws ApiException if the Api call fails + */ + @Test + public void consolidateArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayConsolidationRequest consolidateRequest = null; + api.consolidateArray(workspace, teamspace, array, consolidateRequest); + // TODO: test validations + } + + /** + * create a array schema at a specified URI registered to a group/project + * + * @throws ApiException if the Api call fails + */ + @Test + public void createArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + ArraySchema arraySchema = null; + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = null; + api.createArray(workspace, teamspace, array, contentType, arraySchema, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); + // TODO: test validations + } + + /** + * delete a array + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + api.deleteArray(workspace, teamspace, array, contentType); + // TODO: test validations + } + + /** + * deregister a array + * + * @throws ApiException if the Api call fails + */ + @Test + public void deregisterArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + api.deregisterArray(workspace, teamspace, array); + // TODO: test validations + } + + /** + * fetch an array's fragment info + * + * @throws ApiException if the Api call fails + */ + @Test + public void fragmentInfoTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + FragmentInfoRequest fragmentInfoRequest = null; + FragmentInfo response = api.fragmentInfo(workspace, teamspace, array, contentType, fragmentInfoRequest); + // TODO: test validations + } + + /** + * get activity log by ID + * + * @throws ApiException if the Api call fails + */ + @Test + public void getActivityLogByIdTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String id = null; + ArrayActivityLog response = api.getActivityLogById(workspace, teamspace, array, id); + // TODO: test validations + } + + /** + * get all array metadata user has access to + * + * @throws ApiException if the Api call fails + */ + @Test + public void getAllArrayMetadataTest() throws ApiException { + String publicShare = null; + List response = api.getAllArrayMetadata(publicShare); + // TODO: test validations + } + + /** + * get an ArraySchema using a url encoded uri + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + ArraySchema response = api.getArray(workspace, teamspace, array, contentType); + // TODO: test validations + } + + /** + * get the max buffer sizes of an array for a subarray + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayMaxBufferSizesTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String subarray = null; + String contentType = null; + String xPayer = null; + MaxBufferSizes response = api.getArrayMaxBufferSizes(workspace, teamspace, array, subarray, contentType, xPayer); + // TODO: test validations + } + + /** + * get metadata from the array in JSON format + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayMetaDataJsonTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Integer length = null; + Integer endTimestamp = null; + Map response = api.getArrayMetaDataJson(workspace, teamspace, array, length, endTimestamp); + // TODO: test validations + } + + /** + * get metadata on an array + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayMetadataTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayInfo response = api.getArrayMetadata(workspace, teamspace, array); + // TODO: test validations + } + + /** + * get metadata on an array + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayMetadataCapnpTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayMetadata response = api.getArrayMetadataCapnp(workspace, teamspace, array); + // TODO: test validations + } + + /** + * get the non empty domain of an array + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayNonEmptyDomainTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + String xPayer = null; + NonEmptyDomain response = api.getArrayNonEmptyDomain(workspace, teamspace, array, contentType, xPayer); + // TODO: test validations + } + + /** + * get non-empty domain from the array in json format + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayNonEmptyDomainJsonTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Map response = api.getArrayNonEmptyDomainJson(workspace, teamspace, array); + // TODO: test validations + } + + /** + * get an sample set of data from the array + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArraySampleDataTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + BigDecimal samples = null; + ArraySample response = api.getArraySampleData(workspace, teamspace, array, samples); + // TODO: test validations + } + + /** + * Get all sharing details of the array + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArraySharingPoliciesTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + List response = api.getArraySharingPolicies(workspace, teamspace, array); + // TODO: test validations + } + + /** + * get metadata on all arrays in a namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArraysInNamespaceTest() throws ApiException { + String workspace = null; + String teamspace = null; + Boolean withMetadata = null; + List response = api.getArraysInNamespace(workspace, teamspace, withMetadata); + // TODO: test validations + } + + /** + * Get fragment end_timestamp on an array, will search for the closest end_timestamp to the timestamp asked + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFragmentEndTimestampTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Integer endTimestamp = null; + Integer response = api.getFragmentEndTimestamp(workspace, teamspace, array, endTimestamp); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getLastAccessedArraysTest() throws ApiException { + List response = api.getLastAccessedArrays(); + // TODO: test validations + } + + /** + * request to get the array schema + * + * @throws ApiException if the Api call fails + */ + @Test + public void loadArraySchemaTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + LoadArraySchemaRequest loadArraySchemaRequest = null; + LoadArraySchemaResponse response = api.loadArraySchema(workspace, teamspace, array, loadArraySchemaRequest); + // TODO: test validations + } + + /** + * request to get the enumerations of the arrays' attributes + * + * @throws ApiException if the Api call fails + */ + @Test + public void loadEnumerationsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + LoadEnumerationsRequest loadEnumerationsRequest = null; + LoadEnumerationsResponse response = api.loadEnumerations(workspace, teamspace, array, loadEnumerationsRequest); + // TODO: test validations + } + + /** + * register an array at a specified URI registered to the given namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void registerArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayInfoUpdate arrayMetadata = null; + ArrayInfo response = api.registerArray(workspace, teamspace, array, arrayMetadata); + // TODO: test validations + } + + /** + * Share an array with a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void shareArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArraySharing arraySharing = null; + api.shareArray(workspace, teamspace, array, arraySharing); + // TODO: test validations + } + + /** + * update metadata on an array + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateArrayMetadataTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayInfoUpdate arrayMetadata = null; + api.updateArrayMetadata(workspace, teamspace, array, arrayMetadata); + // TODO: test validations + } + + /** + * update metadata on an array + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateArrayMetadataCapnpTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayMetadata arrayMetadataEntries = null; + api.updateArrayMetadataCapnp(workspace, teamspace, array, arrayMetadataEntries); + // TODO: test validations + } + + /** + * vacuum an array at a specified URI + * + * @throws ApiException if the Api call fails + */ + @Test + public void vacuumArrayTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayVacuumRequest vaccumRequest = null; + api.vacuumArray(workspace, teamspace, array, vaccumRequest); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/ArrayTasksApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/ArrayTasksApiTest.java new file mode 100644 index 0000000..9312613 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/ArrayTasksApiTest.java @@ -0,0 +1,46 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayTaskBrowserSidebar; +import io.tiledb.cloud.rest_api.model.Error; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ArrayTasksApi + */ +@Disabled +public class ArrayTasksApiTest { + + private final ArrayTasksApi api = new ArrayTasksApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayTasksSidebarTest() throws ApiException { + Integer start = null; + Integer end = null; + ArrayTaskBrowserSidebar response = api.getArrayTasksSidebar(start, end); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/AssetsApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/AssetsApiTest.java new file mode 100644 index 0000000..2d29b8d --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/AssetsApiTest.java @@ -0,0 +1,88 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.AssetListResponse; +import io.tiledb.cloud.rest_api.model.ChangeAssetCredentialsRequest; +import io.tiledb.cloud.rest_api.model.Error; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AssetsApi + */ +@Disabled +public class AssetsApiTest { + + private final AssetsApi api = new AssetsApi(); + + /** + * Changes the access credentials to the given assets + * + * @throws ApiException if the Api call fails + */ + @Test + public void changeAssetCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + ChangeAssetCredentialsRequest changeCredentialsRequest = null; + api.changeAssetCredentials(workspace, teamspace, changeCredentialsRequest); + // TODO: test validations + } + + /** + * List assets in a namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void listAssetsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String assetType = null; + String ownershipLevel = null; + String depth = null; + String search = null; + Integer page = null; + Integer perPage = null; + String orderBy = null; + String expand = null; + AssetListResponse response = api.listAssets(workspace, teamspace, assetType, ownershipLevel, depth, search, page, perPage, orderBy, expand); + // TODO: test validations + } + + /** + * List public assets + * + * @throws ApiException if the Api call fails + */ + @Test + public void listPublicAssetsTest() throws ApiException { + String assetType = null; + String depth = null; + String search = null; + Integer page = null; + Integer perPage = null; + String orderBy = null; + AssetListResponse response = api.listPublicAssets(assetType, depth, search, page, perPage, orderBy); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/FavoritesApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/FavoritesApiTest.java new file mode 100644 index 0000000..fc52832 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/FavoritesApiTest.java @@ -0,0 +1,304 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayFavorite; +import io.tiledb.cloud.rest_api.model.ArrayFavoritesData; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.MLModelFavorite; +import io.tiledb.cloud.rest_api.model.MLModelFavoritesData; +import io.tiledb.cloud.rest_api.model.NotebookFavorite; +import io.tiledb.cloud.rest_api.model.NotebookFavoritesData; +import io.tiledb.cloud.rest_api.model.UDFFavorite; +import io.tiledb.cloud.rest_api.model.UDFFavoritesData; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FavoritesApi + */ +@Disabled +public class FavoritesApiTest { + + private final FavoritesApi api = new FavoritesApi(); + + /** + * Add a new array favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void addArrayFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.addArrayFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Add a new ML model favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void addMLModelFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.addMLModelFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Add a new notebook favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void addNotebookFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.addNotebookFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Add a new UDF favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void addUDFFavoriteTest() throws ApiException { + String workspace = null; + String name = null; + api.addUDFFavorite(workspace, name); + // TODO: test validations + } + + /** + * Delete specific array favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteArrayFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.deleteArrayFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Delete specific ML model favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteMLModelFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.deleteMLModelFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Delete specific notebook favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteNotebookFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.deleteNotebookFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Delete specific UDF favorite + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUDFFavoriteTest() throws ApiException { + String workspace = null; + String name = null; + api.deleteUDFFavorite(workspace, name); + // TODO: test validations + } + + /** + * Fetch array favorite of a specific array + * + * @throws ApiException if the Api call fails + */ + @Test + public void getArrayFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + ArrayFavorite response = api.getArrayFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Fetch ML model favorite of a specific ML model + * + * @throws ApiException if the Api call fails + */ + @Test + public void getMLModelFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + MLModelFavorite response = api.getMLModelFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Fetch notebook favorite of a specific notebook + * + * @throws ApiException if the Api call fails + */ + @Test + public void getNotebookFavoriteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + NotebookFavorite response = api.getNotebookFavorite(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Fetch UDF favorite of a specific UDF + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUDFFavoriteTest() throws ApiException { + String workspace = null; + String name = null; + UDFFavorite response = api.getUDFFavorite(workspace, name); + // TODO: test validations + } + + /** + * Fetch a page of array favorites of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listArrayFavoritesTest() throws ApiException { + Integer page = null; + Integer perPage = null; + ArrayFavoritesData response = api.listArrayFavorites(page, perPage); + // TODO: test validations + } + + /** + * Fetch all favorite array uuids of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listArrayFavoritesUUIDsTest() throws ApiException { + List response = api.listArrayFavoritesUUIDs(); + // TODO: test validations + } + + /** + * Fetch a page of ML models favorites of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listMLModelFavoritesTest() throws ApiException { + Integer page = null; + Integer perPage = null; + MLModelFavoritesData response = api.listMLModelFavorites(page, perPage); + // TODO: test validations + } + + /** + * Fetch all favorite ML models uuids of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listMLModelFavoritesUUIDsTest() throws ApiException { + List response = api.listMLModelFavoritesUUIDs(); + // TODO: test validations + } + + /** + * Fetch a page of notebook favorites of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listNotebookFavoritesTest() throws ApiException { + Boolean isDashboard = null; + Integer page = null; + Integer perPage = null; + NotebookFavoritesData response = api.listNotebookFavorites(isDashboard, page, perPage); + // TODO: test validations + } + + /** + * Fetch all favorite notebook uuids of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listNotebookFavoritesUUIDsTest() throws ApiException { + List response = api.listNotebookFavoritesUUIDs(); + // TODO: test validations + } + + /** + * Fetch a page of UDF favorites of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listUDFFavoritesTest() throws ApiException { + Integer page = null; + Integer perPage = null; + UDFFavoritesData response = api.listUDFFavorites(page, perPage); + // TODO: test validations + } + + /** + * Fetch all favorite UDF uuids of connected user + * + * @throws ApiException if the Api call fails + */ + @Test + public void listUDFFavoritesUUIDsTest() throws ApiException { + List response = api.listUDFFavoritesUUIDs(); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/FilesApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/FilesApiTest.java new file mode 100644 index 0000000..0bd78a0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/FilesApiTest.java @@ -0,0 +1,87 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import java.io.File; +import io.tiledb.cloud.rest_api.model.FileCreate; +import io.tiledb.cloud.rest_api.model.FileCreated; +import io.tiledb.cloud.rest_api.model.FileExport; +import io.tiledb.cloud.rest_api.model.FileExported; +import io.tiledb.cloud.rest_api.model.FileUploaded; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FilesApi + */ +@Disabled +public class FilesApiTest { + + private final FilesApi api = new FilesApi(); + + /** + * Create a tiledb file at the specified location + * + * @throws ApiException if the Api call fails + */ + @Test + public void handleCreateFileTest() throws ApiException { + String workspace = null; + String teamspace = null; + FileCreate fileCreate = null; + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = null; + FileCreated response = api.handleCreateFile(workspace, teamspace, fileCreate, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME); + // TODO: test validations + } + + /** + * Export a TileDB File back to its original file format + * + * @throws ApiException if the Api call fails + */ + @Test + public void handleExportFileTest() throws ApiException { + String workspace = null; + String teamspace = null; + String _file = null; + FileExport fileExport = null; + FileExported response = api.handleExportFile(workspace, teamspace, _file, fileExport); + // TODO: test validations + } + + /** + * Upload a tiledb file at the specified location + * + * @throws ApiException if the Api call fails + */ + @Test + public void handleUploadFileTest() throws ApiException { + String workspace = null; + String teamspace = null; + File inputFile = null; + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = null; + String outputUri = null; + String name = null; + FileUploaded response = api.handleUploadFile(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/GroupsApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/GroupsApiTest.java new file mode 100644 index 0000000..c16f530 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/GroupsApiTest.java @@ -0,0 +1,320 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.GroupBrowserData; +import io.tiledb.cloud.rest_api.model.GroupBrowserFilterData; +import io.tiledb.cloud.rest_api.model.GroupChanges; +import io.tiledb.cloud.rest_api.model.GroupContentActivityResponse; +import io.tiledb.cloud.rest_api.model.GroupContents; +import io.tiledb.cloud.rest_api.model.GroupContentsFilterData; +import io.tiledb.cloud.rest_api.model.GroupCreate; +import io.tiledb.cloud.rest_api.model.GroupInfo; +import io.tiledb.cloud.rest_api.model.GroupRegister; +import io.tiledb.cloud.rest_api.model.GroupSharing; +import io.tiledb.cloud.rest_api.model.GroupSharingRequest; +import io.tiledb.cloud.rest_api.model.GroupUpdate; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for GroupsApi + */ +@Disabled +public class GroupsApiTest { + + private final GroupsApi api = new GroupsApi(); + + /** + * Changes the contents of the group by adding/removing members. + * + * @throws ApiException if the Api call fails + */ + @Test + public void changeGroupContentsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + GroupChanges groupChanges = null; + api.changeGroupContents(workspace, teamspace, groupName, groupChanges); + // TODO: test validations + } + + /** + * Creates a new group in the namespace. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createGroupTest() throws ApiException { + String workspace = null; + String teamspace = null; + GroupCreate groupCreate = null; + api.createGroup(workspace, teamspace, groupCreate); + // TODO: test validations + } + + /** + * Deletes the group. The assets are not deleted nor are not relocated to any other group + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteGroupTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + api.deleteGroup(workspace, teamspace, groupName); + // TODO: test validations + } + + /** + * Returns the the group + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGroupTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + GroupInfo response = api.getGroup(workspace, teamspace, groupName); + // TODO: test validations + } + + /** + * Returns the activity of group content + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGroupActivityTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + Integer page = null; + Integer perPage = null; + GroupContentActivityResponse response = api.getGroupActivity(workspace, teamspace, groupName, page, perPage); + // TODO: test validations + } + + /** + * Returns the contents of the group + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGroupContentsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + Integer page = null; + Integer perPage = null; + String namespace = null; + String search = null; + String orderby = null; + List tag = null; + List excludeTag = null; + List memberType = null; + List excludeMemberType = null; + GroupContents response = api.getGroupContents(workspace, teamspace, groupName, page, perPage, namespace, search, orderby, tag, excludeTag, memberType, excludeMemberType); + // TODO: test validations + } + + /** + * Get all sharing details of the group + * + * @throws ApiException if the Api call fails + */ + @Test + public void getGroupSharingPoliciesTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + List response = api.getGroupSharingPolicies(workspace, teamspace, groupName); + // TODO: test validations + } + + /** + * Fetch data to initialize filters for the groups browser + * + * @throws ApiException if the Api call fails + */ + @Test + public void groupsBrowserOwnedFiltersGetTest() throws ApiException { + String namespace = null; + GroupBrowserFilterData response = api.groupsBrowserOwnedFiltersGet(namespace); + // TODO: test validations + } + + /** + * Fetch data to initialize filters for the groups browser + * + * @throws ApiException if the Api call fails + */ + @Test + public void groupsBrowserPublicFiltersGetTest() throws ApiException { + GroupBrowserFilterData response = api.groupsBrowserPublicFiltersGet(); + // TODO: test validations + } + + /** + * Fetch data to initialize filters for the groups browser + * + * @throws ApiException if the Api call fails + */ + @Test + public void groupsBrowserSharedFiltersGetTest() throws ApiException { + String namespace = null; + GroupBrowserFilterData response = api.groupsBrowserSharedFiltersGet(namespace); + // TODO: test validations + } + + /** + * Fetch data to initialize filters for the group contents + * + * @throws ApiException if the Api call fails + */ + @Test + public void groupsWorkspaceTeamspaceGroupNameContentsFiltersGetTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + GroupContentsFilterData response = api.groupsWorkspaceTeamspaceGroupNameContentsFiltersGet(workspace, teamspace, groupName); + // TODO: test validations + } + + /** + * Returns one page of owned groups. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listOwnedGroupsTest() throws ApiException { + Integer page = null; + Integer perPage = null; + String groupType = null; + String search = null; + String namespace = null; + String orderby = null; + String permissions = null; + List tag = null; + List excludeTag = null; + Boolean flat = null; + String parent = null; + Boolean withMetadata = null; + GroupBrowserData response = api.listOwnedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata); + // TODO: test validations + } + + /** + * Returns one page of public groups. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listPublicGroupsTest() throws ApiException { + Integer page = null; + Integer perPage = null; + String groupType = null; + String search = null; + String namespace = null; + String orderby = null; + String permissions = null; + List tag = null; + List excludeTag = null; + Boolean flat = null; + String parent = null; + Boolean withMetadata = null; + GroupBrowserData response = api.listPublicGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, withMetadata); + // TODO: test validations + } + + /** + * Returns one page of shared groups. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listSharedGroupsTest() throws ApiException { + Integer page = null; + Integer perPage = null; + String groupType = null; + String search = null; + String namespace = null; + String orderby = null; + String permissions = null; + List tag = null; + List excludeTag = null; + Boolean flat = null; + String parent = null; + List sharedTo = null; + Boolean withMetadata = null; + GroupBrowserData response = api.listSharedGroups(page, perPage, groupType, search, namespace, orderby, permissions, tag, excludeTag, flat, parent, sharedTo, withMetadata); + // TODO: test validations + } + + /** + * Registers an existing group in the namespace. + * + * @throws ApiException if the Api call fails + */ + @Test + public void registerGroupTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + GroupRegister groupRegister = null; + api.registerGroup(workspace, teamspace, array, groupRegister); + // TODO: test validations + } + + /** + * Share a group with a namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void shareGroupTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + GroupSharingRequest groupSharingRequest = null; + api.shareGroup(workspace, teamspace, groupName, groupSharingRequest); + // TODO: test validations + } + + /** + * Changes attributes of the group + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateGroupTest() throws ApiException { + String workspace = null; + String teamspace = null; + String groupName = null; + GroupUpdate groupUpdate = null; + api.updateGroup(workspace, teamspace, groupName, groupUpdate); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/InvitationApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/InvitationApiTest.java new file mode 100644 index 0000000..75fdca6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/InvitationApiTest.java @@ -0,0 +1,187 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.InvitationArrayShareEmail; +import io.tiledb.cloud.rest_api.model.InvitationData; +import io.tiledb.cloud.rest_api.model.InvitationFailedRecipients; +import io.tiledb.cloud.rest_api.model.InvitationGroupShareEmail; +import io.tiledb.cloud.rest_api.model.InvitationOrganizationJoinEmail; +import io.tiledb.cloud.rest_api.model.SharePaymentRequest; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for InvitationApi + */ +@Disabled +public class InvitationApiTest { + + private final InvitationApi api = new InvitationApi(); + + /** + * Accepts invitation + * + * @throws ApiException if the Api call fails + */ + @Test + public void acceptInvitationTest() throws ApiException { + String invitation = null; + api.acceptInvitation(invitation); + // TODO: test validations + } + + /** + * Cancels join organization invitation + * + * @throws ApiException if the Api call fails + */ + @Test + public void cancelJoinOrganizationTest() throws ApiException { + String invitation = null; + String organization = null; + api.cancelJoinOrganization(invitation, organization); + // TODO: test validations + } + + /** + * Cancels array sharing invitation + * + * @throws ApiException if the Api call fails + */ + @Test + public void cancelShareArrayByInviteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String invitation = null; + String array = null; + api.cancelShareArrayByInvite(workspace, teamspace, invitation, array); + // TODO: test validations + } + + /** + * Cancels group sharing invitation + * + * @throws ApiException if the Api call fails + */ + @Test + public void cancelShareGroupByInviteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String invitation = null; + String groupName = null; + api.cancelShareGroupByInvite(workspace, teamspace, invitation, groupName); + // TODO: test validations + } + + /** + * Revokes invitation from the source namespace to the target. + * + * @throws ApiException if the Api call fails + */ + @Test + public void cancelSharePaymentTest() throws ApiException { + String workspace = null; + String teamspace = null; + String target = null; + api.cancelSharePayment(workspace, teamspace, target); + // TODO: test validations + } + + /** + * Fetch a list of invitations + * + * @throws ApiException if the Api call fails + */ + @Test + public void fetchInvitationsTest() throws ApiException { + String organization = null; + String array = null; + String group = null; + Integer start = null; + Integer end = null; + Integer page = null; + Integer perPage = null; + String type = null; + String status = null; + String orderby = null; + InvitationData response = api.fetchInvitations(organization, array, group, start, end, page, perPage, type, status, orderby); + // TODO: test validations + } + + /** + * Sends email to multiple recipients with joining information regarding an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void joinOrganizationTest() throws ApiException { + String organization = null; + InvitationOrganizationJoinEmail emailInvite = null; + api.joinOrganization(organization, emailInvite); + // TODO: test validations + } + + /** + * Sends email to multiple recipients with sharing information regarding an array + * + * @throws ApiException if the Api call fails + */ + @Test + public void shareArrayByInviteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + InvitationArrayShareEmail emailInvite = null; + api.shareArrayByInvite(workspace, teamspace, array, emailInvite); + // TODO: test validations + } + + /** + * Sends email to multiple recipients with sharing information regarding a group + * + * @throws ApiException if the Api call fails + */ + @Test + public void shareGroupByInviteTest() throws ApiException { + String workspace = null; + String teamspace = null; + String group = null; + InvitationGroupShareEmail emailInvite = null; + api.shareGroupByInvite(workspace, teamspace, group, emailInvite); + // TODO: test validations + } + + /** + * Sends email to multiple recipients allowing them to use the payment instrument provided by the source namespace. + * + * @throws ApiException if the Api call fails + */ + @Test + public void sharePaymentTest() throws ApiException { + String workspace = null; + String teamspace = null; + SharePaymentRequest emailInvite = null; + api.sharePayment(workspace, teamspace, emailInvite); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/NotebookApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/NotebookApiTest.java new file mode 100644 index 0000000..d607fd9 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/NotebookApiTest.java @@ -0,0 +1,115 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayInfoUpdate; +import io.tiledb.cloud.rest_api.model.Error; +import java.io.File; +import io.tiledb.cloud.rest_api.model.FileUploaded; +import io.tiledb.cloud.rest_api.model.NotebookCopied; +import io.tiledb.cloud.rest_api.model.NotebookCopy; +import io.tiledb.cloud.rest_api.model.NotebookStatus; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for NotebookApi + */ +@Disabled +public class NotebookApiTest { + + private final NotebookApi api = new NotebookApi(); + + /** + * Get status of the notebook server + * + * @throws ApiException if the Api call fails + */ + @Test + public void getNotebookServerStatusTest() throws ApiException { + String workspace = null; + String teamspace = null; + NotebookStatus response = api.getNotebookServerStatus(workspace, teamspace); + // TODO: test validations + } + + /** + * Copy a tiledb notebook at the specified location + * + * @throws ApiException if the Api call fails + */ + @Test + public void handleCopyNotebookTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + NotebookCopy notebookCopy = null; + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = null; + Integer endTimestamp = null; + NotebookCopied response = api.handleCopyNotebook(workspace, teamspace, array, notebookCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp); + // TODO: test validations + } + + /** + * Upload a notebook at the specified location + * + * @throws ApiException if the Api call fails + */ + @Test + public void handleUploadNotebookTest() throws ApiException { + String workspace = null; + String teamspace = null; + File inputFile = null; + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = null; + String outputUri = null; + String name = null; + FileUploaded response = api.handleUploadNotebook(workspace, teamspace, inputFile, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, outputUri, name); + // TODO: test validations + } + + /** + * Shutdown a notebook server + * + * @throws ApiException if the Api call fails + */ + @Test + public void shutdownNotebookServerTest() throws ApiException { + String workspace = null; + String teamspace = null; + api.shutdownNotebookServer(workspace, teamspace); + // TODO: test validations + } + + /** + * update name on a notebok, moving related S3 object to new location + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateNotebookNameTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + ArrayInfoUpdate notebookMetadata = null; + api.updateNotebookName(workspace, teamspace, array, notebookMetadata); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/NotebooksApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/NotebooksApiTest.java new file mode 100644 index 0000000..34cc361 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/NotebooksApiTest.java @@ -0,0 +1,66 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayEndTimestampData; +import io.tiledb.cloud.rest_api.model.Error; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for NotebooksApi + */ +@Disabled +public class NotebooksApiTest { + + private final NotebooksApi api = new NotebooksApi(); + + /** + * retrieve a list of timestamps from the array fragment info listing in milliseconds, paginated + * + * @throws ApiException if the Api call fails + */ + @Test + public void notebooksWorkspaceTeamspaceArrayEndTimestampsGetTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Integer page = null; + Integer perPage = null; + ArrayEndTimestampData response = api.notebooksWorkspaceTeamspaceArrayEndTimestampsGet(workspace, teamspace, array, page, perPage); + // TODO: test validations + } + + /** + * prune fragments of the notebook + * + * @throws ApiException if the Api call fails + */ + @Test + public void notebooksWorkspaceTeamspaceArrayPrunePostTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + Integer keepVersions = null; + api.notebooksWorkspaceTeamspaceArrayPrunePost(workspace, teamspace, array, keepVersions); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/OrganizationApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/OrganizationApiTest.java new file mode 100644 index 0000000..f6b6448 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/OrganizationApiTest.java @@ -0,0 +1,302 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.AWSAccessCredentials; +import io.tiledb.cloud.rest_api.model.DomainCheckResult; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.Organization; +import io.tiledb.cloud.rest_api.model.OrganizationUpdate; +import io.tiledb.cloud.rest_api.model.OrganizationUser; +import io.tiledb.cloud.rest_api.model.SSODomainConfig; +import io.tiledb.cloud.rest_api.model.SSODomainConfigResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for OrganizationApi + */ +@Disabled +public class OrganizationApiTest { + + private final OrganizationApi api = new OrganizationApi(); + + /** + * Add aws keys + * + * @throws ApiException if the Api call fails + */ + @Test + public void addAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + AWSAccessCredentials awsAccessCredentials = null; + api.addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials); + // TODO: test validations + } + + /** + * add a user to an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void addUserToOrganizationTest() throws ApiException { + String organization = null; + OrganizationUser user = null; + api.addUserToOrganization(organization, user); + // TODO: test validations + } + + /** + * Check if aws keys are set + * + * @throws ApiException if the Api call fails + */ + @Test + public void checkAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + List response = api.checkAWSAccessCredentials(workspace, teamspace); + // TODO: test validations + } + + /** + * Check if aws keys are set by name + * + * @throws ApiException if the Api call fails + */ + @Test + public void checkAWSAccessCredentialsByNameTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + AWSAccessCredentials response = api.checkAWSAccessCredentialsByName(workspace, teamspace, name); + // TODO: test validations + } + + /** + * Immediately verify ownership of the specified SSO domain ownership claim. + * + * @throws ApiException if the Api call fails + */ + @Test + public void checkSSODomainTest() throws ApiException { + String organization = null; + String uuid = null; + DomainCheckResult response = api.checkSSODomain(organization, uuid); + // TODO: test validations + } + + /** + * create a organization, the user creating will be listed as owner + * + * @throws ApiException if the Api call fails + */ + @Test + public void createOrganizationTest() throws ApiException { + Organization organization = null; + api.createOrganization(organization); + // TODO: test validations + } + + /** + * Create a new SSO connection that connects this organization to this domain. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createSSODomainTest() throws ApiException { + String organization = null; + SSODomainConfig config = null; + SSODomainConfig response = api.createSSODomain(organization, config); + // TODO: test validations + } + + /** + * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.deleteAWSAccessCredentials(workspace, teamspace, name); + // TODO: test validations + } + + /** + * delete a organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteOrganizationTest() throws ApiException { + String organization = null; + api.deleteOrganization(organization); + // TODO: test validations + } + + /** + * Deletes the configuration for the given SSO connection. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteSSODomainTest() throws ApiException { + String organization = null; + String uuid = null; + api.deleteSSODomain(organization, uuid); + // TODO: test validations + } + + /** + * delete a user from an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserFromOrganizationTest() throws ApiException { + String organization = null; + String username = null; + api.deleteUserFromOrganization(organization, username); + // TODO: test validations + } + + /** + * get all organizations that the user is member of + * + * @throws ApiException if the Api call fails + */ + @Test + public void getAllOrganizationsTest() throws ApiException { + List response = api.getAllOrganizations(); + // TODO: test validations + } + + /** + * get a organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrganizationTest() throws ApiException { + String organization = null; + Organization response = api.getOrganization(organization); + // TODO: test validations + } + + /** + * get a user from an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrganizationUserTest() throws ApiException { + String organization = null; + String username = null; + OrganizationUser response = api.getOrganizationUser(organization, username); + // TODO: test validations + } + + /** + * Gets details about the given SSO domain connection. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSSODomainTest() throws ApiException { + String organization = null; + String uuid = null; + SSODomainConfig response = api.getSSODomain(organization, uuid); + // TODO: test validations + } + + /** + * Lists all the SSO connections associated with the given organization. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSSODomainsTest() throws ApiException { + String organization = null; + SSODomainConfigResponse response = api.getSSODomains(organization); + // TODO: test validations + } + + /** + * Update aws keys or associated buckets. This will update the key associations for each array in the namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + AWSAccessCredentials awsAccessCredentials = null; + api.updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials); + // TODO: test validations + } + + /** + * update a organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateOrganizationTest() throws ApiException { + String organization = null; + OrganizationUpdate organizationDetails = null; + api.updateOrganization(organization, organizationDetails); + // TODO: test validations + } + + /** + * Updates the configuration for the given SSO connection. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateSSODomainTest() throws ApiException { + String organization = null; + String uuid = null; + SSODomainConfig config = null; + SSODomainConfig response = api.updateSSODomain(organization, uuid, config); + // TODO: test validations + } + + /** + * update a user in an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUserInOrganizationTest() throws ApiException { + String organization = null; + String username = null; + OrganizationUser user = null; + api.updateUserInOrganization(organization, username, user); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/QueryApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/QueryApiTest.java new file mode 100644 index 0000000..ec6f13b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/QueryApiTest.java @@ -0,0 +1,127 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import java.io.File; +import io.tiledb.cloud.rest_api.model.Query; +import io.tiledb.cloud.rest_api.model.QueryJson; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for QueryApi + */ +@Disabled +public class QueryApiTest { + + private final QueryApi api = new QueryApi(); + + /** + * send a query to run against a specified array/URI registered to a group/project + * + * @throws ApiException if the Api call fails + */ + @Test + public void finalizeQueryTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String type = null; + String contentType = null; + Query query = null; + String xPayer = null; + Integer openAt = null; + Query response = api.finalizeQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt); + // TODO: test validations + } + + /** + * send a query to run against a specified array/URI registered to a group/project + * + * @throws ApiException if the Api call fails + */ + @Test + public void getEstResultSizesTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String type = null; + String contentType = null; + Query query = null; + String xPayer = null; + Integer openAt = null; + Query response = api.getEstResultSizes(workspace, teamspace, array, type, contentType, query, xPayer, openAt); + // TODO: test validations + } + + /** + * send a query to run against a specified array/URI registered to a group/project, returns file bytes + * + * @throws ApiException if the Api call fails + */ + @Test + public void getFileTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + String xPayer = null; + File response = api.getFile(workspace, teamspace, array, contentType, xPayer); + // TODO: test validations + } + + /** + * send a query to run against a specified array/URI registered to a group/project + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitQueryTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String type = null; + String contentType = null; + Query query = null; + String xPayer = null; + Integer openAt = null; + Query response = api.submitQuery(workspace, teamspace, array, type, contentType, query, xPayer, openAt); + // TODO: test validations + } + + /** + * send a query to run against a specified array/URI registered to a group/project, returns JSON results + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitQueryJsonTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + String contentType = null; + QueryJson queryJson = null; + String xPayer = null; + Object response = api.submitQueryJson(workspace, teamspace, array, contentType, queryJson, xPayer); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApiTest.java new file mode 100644 index 0000000..25bbb5c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/RegisteredTaskGraphsApiTest.java @@ -0,0 +1,117 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.RegisteredTaskGraph; +import io.tiledb.cloud.rest_api.model.TaskGraphSharing; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for RegisteredTaskGraphsApi + */ +@Disabled +public class RegisteredTaskGraphsApiTest { + + private final RegisteredTaskGraphsApi api = new RegisteredTaskGraphsApi(); + + /** + * Delete the given registered task graph. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteRegisteredTaskGraphTest() throws ApiException { + String workspace = null; + String name = null; + api.deleteRegisteredTaskGraph(workspace, name); + // TODO: test validations + } + + /** + * Fetch the contents of this registered task graph. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRegisteredTaskGraphTest() throws ApiException { + String workspace = null; + String name = null; + RegisteredTaskGraph response = api.getRegisteredTaskGraph(workspace, name); + // TODO: test validations + } + + /** + * Get sharing policies for the task graph. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getRegisteredTaskGraphSharingPoliciesTest() throws ApiException { + String workspace = null; + String name = null; + List response = api.getRegisteredTaskGraphSharingPolicies(workspace, name); + // TODO: test validations + } + + /** + * Register a task graph in the given namespace, with the given name. + * + * @throws ApiException if the Api call fails + */ + @Test + public void registerRegisteredTaskGraphTest() throws ApiException { + String workspace = null; + String name = null; + RegisteredTaskGraph graph = null; + api.registerRegisteredTaskGraph(workspace, name, graph); + // TODO: test validations + } + + /** + * Share a task graph. + * + * @throws ApiException if the Api call fails + */ + @Test + public void shareRegisteredTaskGraphTest() throws ApiException { + String workspace = null; + String name = null; + TaskGraphSharing taskGraphSharing = null; + api.shareRegisteredTaskGraph(workspace, name, taskGraphSharing); + // TODO: test validations + } + + /** + * Update the contents of an existing registered task graph. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateRegisteredTaskGraphTest() throws ApiException { + String workspace = null; + String name = null; + RegisteredTaskGraph graph = null; + api.updateRegisteredTaskGraph(workspace, name, graph); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/SqlApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/SqlApiTest.java new file mode 100644 index 0000000..35dfa82 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/SqlApiTest.java @@ -0,0 +1,50 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.SQLParameters; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for SqlApi + */ +@Disabled +public class SqlApiTest { + + private final SqlApi api = new SqlApi(); + + /** + * Run a sql query + * + * @throws ApiException if the Api call fails + */ + @Test + public void runSQLTest() throws ApiException { + String workspace = null; + String teamspace = null; + SQLParameters sql = null; + String acceptEncoding = null; + List> response = api.runSQL(workspace, teamspace, sql, acceptEncoding); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/StatsApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/StatsApiTest.java new file mode 100644 index 0000000..4ddebd1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/StatsApiTest.java @@ -0,0 +1,46 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.GetTiledbStats200Response; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StatsApi + */ +@Disabled +public class StatsApiTest { + + private final StatsApi api = new StatsApi(); + + /** + * Fetch libtiledb stat + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTiledbStatsTest() throws ApiException { + GetTiledbStats200Response response = api.getTiledbStats(); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApiTest.java new file mode 100644 index 0000000..47ca575 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphLogsApiTest.java @@ -0,0 +1,162 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import java.time.OffsetDateTime; +import io.tiledb.cloud.rest_api.model.TaskGraphClientNodeStatus; +import io.tiledb.cloud.rest_api.model.TaskGraphLog; +import io.tiledb.cloud.rest_api.model.TaskGraphLogsData; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TaskGraphLogsApi + */ +@Disabled +public class TaskGraphLogsApiTest { + + private final TaskGraphLogsApi api = new TaskGraphLogsApi(); + + /** + * Create a task graph log. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createTaskGraphLogTest() throws ApiException { + String workspace = null; + TaskGraphLog log = null; + TaskGraphLog response = api.createTaskGraphLog(workspace, log); + // TODO: test validations + } + + /** + * Fetch information about a single task graph execution. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTaskGraphLogTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraphLog response = api.getTaskGraphLog(workspace, id); + // TODO: test validations + } + + /** + * Fetch the task graph logs of a namespace the user has access to. The returned entries will include only summary data, and will not include information about the individual tasks that were executed. (This information is available when requesting an individual task graph log.) Entries in the response are ordered from newest to oldest. Pagination parameters work as in other API methods; see PaginationMetadata. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listTaskGraphLogsTest() throws ApiException { + String namespace = null; + String createdBy = null; + String status = null; + String search = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + Integer page = null; + Integer perPage = null; + TaskGraphLogsData response = api.listTaskGraphLogs(namespace, createdBy, status, search, startTime, endTime, page, perPage); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void reportClientNodeTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraphClientNodeStatus report = null; + api.reportClientNode(workspace, id, report); + // TODO: test validations + } + + /** + * Resubmits a task graph in the given namespace using the associated execution id. + * + * @throws ApiException if the Api call fails + */ + @Test + public void resubmitTaskGraphExecutionTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraphLog response = api.resubmitTaskGraphExecution(workspace, id); + // TODO: test validations + } + + /** + * Retries failed tasks of a task graph in the given namespace using the associated execution id. + * + * @throws ApiException if the Api call fails + */ + @Test + public void retryTaskGraphExecutionTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraphLog response = api.retryTaskGraphExecution(workspace, id); + // TODO: test validations + } + + /** + * Stops a task graph execution in the given namespace using the associated associated execution id. + * + * @throws ApiException if the Api call fails + */ + @Test + public void stopTaskGraphExecutionTest() throws ApiException { + String workspace = null; + String id = null; + api.stopTaskGraphExecution(workspace, id); + // TODO: test validations + } + + /** + * Submit a single task graph for execution. + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitTaskGraphTest() throws ApiException { + String workspace = null; + String id = null; + String rootTaskGraphUuid = null; + TaskGraphLog response = api.submitTaskGraph(workspace, id, rootTaskGraphUuid); + // TODO: test validations + } + + /** + * Update information about a single task graph execution. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateTaskGraphLogTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraphLog log = null; + api.updateTaskGraphLog(workspace, id, log); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphsApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphsApiTest.java new file mode 100644 index 0000000..3baf564 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/TaskGraphsApiTest.java @@ -0,0 +1,103 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.TaskGraph; +import io.tiledb.cloud.rest_api.model.TaskGraphLog; +import io.tiledb.cloud.rest_api.model.TaskGraphs; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TaskGraphsApi + */ +@Disabled +public class TaskGraphsApiTest { + + private final TaskGraphsApi api = new TaskGraphsApi(); + + /** + * Create a single task graph for execution. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createTaskGraphTest() throws ApiException { + String workspace = null; + TaskGraph graph = null; + TaskGraph response = api.createTaskGraph(workspace, graph); + // TODO: test validations + } + + /** + * Fetch information about a single task graph. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTaskGraphTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraph response = api.getTaskGraph(workspace, id); + // TODO: test validations + } + + /** + * Fetch the task graphs of a namespace the user has access to. The returned entries will include only summary data, and will not include information about the individual tasks that were executed. (This information is available when requesting an individual task graph log.) Entries in the response are ordered from newest to oldest. Pagination parameters work as in other API methods; see PaginationMetadata. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listTaskGraphsTest() throws ApiException { + String workspace = null; + TaskGraphs response = api.listTaskGraphs(workspace); + // TODO: test validations + } + + /** + * Submit a single task graph for execution. + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitTaskGraphTest() throws ApiException { + String workspace = null; + String id = null; + String rootTaskGraphUuid = null; + TaskGraphLog response = api.submitTaskGraph(workspace, id, rootTaskGraphUuid); + // TODO: test validations + } + + /** + * Update information about a single task graph execution. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateTaskGraphTest() throws ApiException { + String workspace = null; + String id = null; + TaskGraph graph = null; + api.updateTaskGraph(workspace, id, graph); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/TasksApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/TasksApiTest.java new file mode 100644 index 0000000..2bd411d --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/TasksApiTest.java @@ -0,0 +1,102 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayTask; +import io.tiledb.cloud.rest_api.model.ArrayTaskData; +import io.tiledb.cloud.rest_api.model.Error; +import io.tiledb.cloud.rest_api.model.SQLParameters; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TasksApi + */ +@Disabled +public class TasksApiTest { + + private final TasksApi api = new TasksApi(); + + /** + * Run a sql query + * + * @throws ApiException if the Api call fails + */ + @Test + public void runSQLTest() throws ApiException { + String workspace = null; + String teamspace = null; + SQLParameters sql = null; + String acceptEncoding = null; + List> response = api.runSQL(workspace, teamspace, sql, acceptEncoding); + // TODO: test validations + } + + /** + * Fetch an array task + * + * @throws ApiException if the Api call fails + */ + @Test + public void taskIdGetTest() throws ApiException { + String id = null; + ArrayTask response = api.taskIdGet(id); + // TODO: test validations + } + + /** + * Retrieve results of an array task + * + * @throws ApiException if the Api call fails + */ + @Test + public void taskIdResultGetTest() throws ApiException { + String id = null; + String acceptEncoding = null; + String response = api.taskIdResultGet(id, acceptEncoding); + // TODO: test validations + } + + /** + * Fetch a list of all array tasks a user has access to + * + * @throws ApiException if the Api call fails + */ + @Test + public void tasksGetTest() throws ApiException { + String namespace = null; + String createdBy = null; + String array = null; + Integer start = null; + Integer end = null; + Integer page = null; + Integer perPage = null; + String type = null; + List excludeType = null; + List fileType = null; + List excludeFileType = null; + String status = null; + String search = null; + String orderby = null; + ArrayTaskData response = api.tasksGet(namespace, createdBy, array, start, end, page, perPage, type, excludeType, fileType, excludeFileType, status, search, orderby); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/UdfApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/UdfApiTest.java new file mode 100644 index 0000000..c178e1c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/UdfApiTest.java @@ -0,0 +1,201 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.ArrayEndTimestampData; +import io.tiledb.cloud.rest_api.model.Error; +import java.io.File; +import io.tiledb.cloud.rest_api.model.GenericUDF; +import io.tiledb.cloud.rest_api.model.MultiArrayUDF; +import io.tiledb.cloud.rest_api.model.UDFCopied; +import io.tiledb.cloud.rest_api.model.UDFCopy; +import io.tiledb.cloud.rest_api.model.UDFInfo; +import io.tiledb.cloud.rest_api.model.UDFInfoUpdate; +import io.tiledb.cloud.rest_api.model.UDFSharing; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UdfApi + */ +@Disabled +public class UdfApiTest { + + private final UdfApi api = new UdfApi(); + + /** + * delete a registered UDF -- this will remove all sharing and can not be undone + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUDFInfoTest() throws ApiException { + String workspace = null; + String name = null; + api.deleteUDFInfo(workspace, name); + // TODO: test validations + } + + /** + * get a specific UDF in the given namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUDFInfoTest() throws ApiException { + String workspace = null; + String name = null; + UDFInfo response = api.getUDFInfo(workspace, name); + // TODO: test validations + } + + /** + * Get all sharing details of the UDF + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUDFInfoSharingPoliciesTest() throws ApiException { + String workspace = null; + String name = null; + List response = api.getUDFInfoSharingPolicies(workspace, name); + // TODO: test validations + } + + /** + * Copy a tiledb udf at the specified location + * + * @throws ApiException if the Api call fails + */ + @Test + public void handleCopyUDFTest() throws ApiException { + String workspace = null; + String name = null; + UDFCopy udFCopy = null; + String X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME = null; + Integer endTimestamp = null; + UDFCopied response = api.handleCopyUDF(workspace, name, udFCopy, X_TILEDB_CLOUD_ACCESS_CREDENTIALS_NAME, endTimestamp); + // TODO: test validations + } + + /** + * register a UDF in the given namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void registerUDFInfoTest() throws ApiException { + String workspace = null; + String name = null; + UDFInfoUpdate udf = null; + api.registerUDFInfo(workspace, name, udf); + // TODO: test validations + } + + /** + * Share a UDF with a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void shareUDFInfoTest() throws ApiException { + String workspace = null; + String name = null; + UDFSharing udfSharing = null; + api.shareUDFInfo(workspace, name, udfSharing); + // TODO: test validations + } + + /** + * submit a generic UDF in the given namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitGenericUDFTest() throws ApiException { + String workspace = null; + GenericUDF udf = null; + String acceptEncoding = null; + File response = api.submitGenericUDF(workspace, udf, acceptEncoding); + // TODO: test validations + } + + /** + * submit a multi-array UDF in the given namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitMultiArrayUDFTest() throws ApiException { + String workspace = null; + MultiArrayUDF udf = null; + String acceptEncoding = null; + File response = api.submitMultiArrayUDF(workspace, udf, acceptEncoding); + // TODO: test validations + } + + /** + * send a UDF to run against a specified array/URI registered to a group/project + * + * @throws ApiException if the Api call fails + */ + @Test + public void submitUDFTest() throws ApiException { + String workspace = null; + String teamspace = null; + String array = null; + MultiArrayUDF udf = null; + String xPayer = null; + String acceptEncoding = null; + String v2 = null; + File response = api.submitUDF(workspace, teamspace, array, udf, xPayer, acceptEncoding, v2); + // TODO: test validations + } + + /** + * retrieve a list of timestamps from the array fragment info listing in milliseconds, paginated + * + * @throws ApiException if the Api call fails + */ + @Test + public void udfWorkspaceArrayEndTimestampsGetTest() throws ApiException { + String workspace = null; + String array = null; + Integer page = null; + Integer perPage = null; + ArrayEndTimestampData response = api.udfWorkspaceArrayEndTimestampsGet(workspace, array, page, perPage); + // TODO: test validations + } + + /** + * update an existing registered UDF in the given namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUDFInfoTest() throws ApiException { + String workspace = null; + String name = null; + UDFInfoUpdate udf = null; + api.updateUDFInfo(workspace, name, udf); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/api/UserApiTest.java b/src/test/java/io/tiledb/cloud/rest_api/api/UserApiTest.java new file mode 100644 index 0000000..dcd9e1c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/api/UserApiTest.java @@ -0,0 +1,318 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.api; + +import io.tiledb.cloud.rest_api.ApiException; +import io.tiledb.cloud.rest_api.model.AWSAccessCredentials; +import io.tiledb.cloud.rest_api.model.Error; +import java.time.OffsetDateTime; +import io.tiledb.cloud.rest_api.model.OrganizationUser; +import io.tiledb.cloud.rest_api.model.ResetUserPasswordRequest; +import io.tiledb.cloud.rest_api.model.Token; +import io.tiledb.cloud.rest_api.model.TokenRequest; +import io.tiledb.cloud.rest_api.model.TokenScope; +import io.tiledb.cloud.rest_api.model.User; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UserApi + */ +@Disabled +public class UserApiTest { + + private final UserApi api = new UserApi(); + + /** + * Add aws keys + * + * @throws ApiException if the Api call fails + */ + @Test + public void addAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + AWSAccessCredentials awsAccessCredentials = null; + api.addAWSAccessCredentials(workspace, teamspace, awsAccessCredentials); + // TODO: test validations + } + + /** + * add a user to an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void addUserToOrganizationTest() throws ApiException { + String organization = null; + OrganizationUser user = null; + api.addUserToOrganization(organization, user); + // TODO: test validations + } + + /** + * Check if aws keys are set + * + * @throws ApiException if the Api call fails + */ + @Test + public void checkAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + List response = api.checkAWSAccessCredentials(workspace, teamspace); + // TODO: test validations + } + + /** + * Check if aws keys are set by name + * + * @throws ApiException if the Api call fails + */ + @Test + public void checkAWSAccessCredentialsByNameTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + AWSAccessCredentials response = api.checkAWSAccessCredentialsByName(workspace, teamspace, name); + // TODO: test validations + } + + /** + * confirm user email + * + * @throws ApiException if the Api call fails + */ + @Test + public void confirmEmailTest() throws ApiException { + api.confirmEmail(); + // TODO: test validations + } + + /** + * create a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User user = null; + api.createUser(user); + // TODO: test validations + } + + /** + * delete a AWS Access credentials in a namespace. This will likely cause arrays to become unreachable + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + api.deleteAWSAccessCredentials(workspace, teamspace, name); + // TODO: test validations + } + + /** + * delete a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); + // TODO: test validations + } + + /** + * delete a user from an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserFromOrganizationTest() throws ApiException { + String organization = null; + String username = null; + api.deleteUserFromOrganization(organization, username); + // TODO: test validations + } + + /** + * get a user from an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrganizationUserTest() throws ApiException { + String organization = null; + String username = null; + OrganizationUser response = api.getOrganizationUser(organization, username); + // TODO: test validations + } + + /** + * Get session token for user + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSessionTest() throws ApiException { + String rememberMe = null; + OffsetDateTime expires = null; + Token response = api.getSession(rememberMe, expires); + // TODO: test validations + } + + /** + * retrieves available token scopes for a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTokenScopesTest() throws ApiException { + List response = api.getTokenScopes(); + // TODO: test validations + } + + /** + * get a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUserTest() throws ApiException { + User response = api.getUser(); + // TODO: test validations + } + + /** + * get a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUserWithUsernameTest() throws ApiException { + String username = null; + User response = api.getUserWithUsername(username); + // TODO: test validations + } + + /** + * Request an authorization token, optionally taken a TokenRequest object to set parameters on the token + * + * @throws ApiException if the Api call fails + */ + @Test + public void requestTokenTest() throws ApiException { + TokenRequest tokenRequest = null; + Token response = api.requestToken(tokenRequest); + // TODO: test validations + } + + /** + * reset user password + * + * @throws ApiException if the Api call fails + */ + @Test + public void resetUserPasswordTest() throws ApiException { + ResetUserPasswordRequest user = null; + api.resetUserPassword(user); + // TODO: test validations + } + + /** + * revoke an authorization token + * + * @throws ApiException if the Api call fails + */ + @Test + public void revokeTokenTest() throws ApiException { + String token = null; + api.revokeToken(token); + // TODO: test validations + } + + /** + * Fetch a list of user tokens + * + * @throws ApiException if the Api call fails + */ + @Test + public void tokensGetTest() throws ApiException { + List response = api.tokensGet(); + // TODO: test validations + } + + /** + * Fetch a list of user session tokens + * + * @throws ApiException if the Api call fails + */ + @Test + public void tokensSessionGetTest() throws ApiException { + List response = api.tokensSessionGet(); + // TODO: test validations + } + + /** + * Update aws keys or associated buckets. This will update the key associations for each array in the namespace + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateAWSAccessCredentialsTest() throws ApiException { + String workspace = null; + String teamspace = null; + String name = null; + AWSAccessCredentials awsAccessCredentials = null; + api.updateAWSAccessCredentials(workspace, teamspace, name, awsAccessCredentials); + // TODO: test validations + } + + /** + * update a user + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User user = null; + api.updateUser(username, user); + // TODO: test validations + } + + /** + * update a user in an organization + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUserInOrganizationTest() throws ApiException { + String organization = null; + String username = null; + OrganizationUser user = null; + api.updateUserInOrganization(organization, username, user); + // TODO: test validations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentialsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentialsTest.java new file mode 100644 index 0000000..bb3820c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AWSAccessCredentialsTest.java @@ -0,0 +1,107 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AWSAccessCredentials + */ +public class AWSAccessCredentialsTest { + private final AWSAccessCredentials model = new AWSAccessCredentials(); + + /** + * Model tests for AWSAccessCredentials + */ + @Test + public void testAWSAccessCredentials() { + // TODO: test AWSAccessCredentials + } + + /** + * Test the property 'secretAccessKey' + */ + @Test + public void secretAccessKeyTest() { + // TODO: test secretAccessKey + } + + /** + * Test the property 'accessKeyId' + */ + @Test + public void accessKeyIdTest() { + // TODO: test accessKeyId + } + + /** + * Test the property 'serviceRoleArn' + */ + @Test + public void serviceRoleArnTest() { + // TODO: test serviceRoleArn + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property '_default' + */ + @Test + public void _defaultTest() { + // TODO: test _default + } + + /** + * Test the property 'buckets' + */ + @Test + public void bucketsTest() { + // TODO: test buckets + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ActivityEventTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ActivityEventTypeTest.java new file mode 100644 index 0000000..ad9bacb --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ActivityEventTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ActivityEventType + */ +public class ActivityEventTypeTest { + /** + * Model tests for ActivityEventType + */ + @Test + public void testActivityEventType() { + // TODO: test ActivityEventType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayActionsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayActionsTest.java new file mode 100644 index 0000000..6eb1923 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayActionsTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayActions + */ +public class ArrayActionsTest { + /** + * Model tests for ArrayActions + */ + @Test + public void testArrayActions() { + // TODO: test ArrayActions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayActivityLogTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayActivityLogTest.java new file mode 100644 index 0000000..379bed2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayActivityLogTest.java @@ -0,0 +1,114 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ActivityEventType; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayActivityLog + */ +public class ArrayActivityLogTest { + private final ArrayActivityLog model = new ArrayActivityLog(); + + /** + * Model tests for ArrayActivityLog + */ + @Test + public void testArrayActivityLog() { + // TODO: test ArrayActivityLog + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'bytesSent' + */ + @Test + public void bytesSentTest() { + // TODO: test bytesSent + } + + /** + * Test the property 'bytesReceived' + */ + @Test + public void bytesReceivedTest() { + // TODO: test bytesReceived + } + + /** + * Test the property 'arrayTaskId' + */ + @Test + public void arrayTaskIdTest() { + // TODO: test arrayTaskId + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'queryRanges' + */ + @Test + public void queryRangesTest() { + // TODO: test queryRanges + } + + /** + * Test the property 'queryStats' + */ + @Test + public void queryStatsTest() { + // TODO: test queryStats + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserDataTest.java new file mode 100644 index 0000000..7742551 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayBrowserData + */ +public class ArrayBrowserDataTest { + private final ArrayBrowserData model = new ArrayBrowserData(); + + /** + * Model tests for ArrayBrowserData + */ + @Test + public void testArrayBrowserData() { + // TODO: test ArrayBrowserData + } + + /** + * Test the property 'arrays' + */ + @Test + public void arraysTest() { + // TODO: test arrays + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebarTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebarTest.java new file mode 100644 index 0000000..b8520e1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayBrowserSidebarTest.java @@ -0,0 +1,66 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayBrowserSidebar + */ +public class ArrayBrowserSidebarTest { + private final ArrayBrowserSidebar model = new ArrayBrowserSidebar(); + + /** + * Model tests for ArrayBrowserSidebar + */ + @Test + public void testArrayBrowserSidebar() { + // TODO: test ArrayBrowserSidebar + } + + /** + * Test the property 'namespaces' + */ + @Test + public void namespacesTest() { + // TODO: test namespaces + } + + /** + * Test the property 'resultCountForAll' + */ + @Test + public void resultCountForAllTest() { + // TODO: test resultCountForAll + } + + /** + * Test the property 'resultCountByNamespace' + */ + @Test + public void resultCountByNamespaceTest() { + // TODO: test resultCountByNamespace + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequestTest.java new file mode 100644 index 0000000..15b87b2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayConsolidationRequestTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TileDBConfig; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayConsolidationRequest + */ +public class ArrayConsolidationRequestTest { + private final ArrayConsolidationRequest model = new ArrayConsolidationRequest(); + + /** + * Model tests for ArrayConsolidationRequest + */ + @Test + public void testArrayConsolidationRequest() { + // TODO: test ArrayConsolidationRequest + } + + /** + * Test the property 'config' + */ + @Test + public void configTest() { + // TODO: test config + } + + /** + * Test the property 'fragments' + */ + @Test + public void fragmentsTest() { + // TODO: test fragments + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampDataTest.java new file mode 100644 index 0000000..ae90d8c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayEndTimestampDataTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayEndTimestampData + */ +public class ArrayEndTimestampDataTest { + private final ArrayEndTimestampData model = new ArrayEndTimestampData(); + + /** + * Model tests for ArrayEndTimestampData + */ + @Test + public void testArrayEndTimestampData() { + // TODO: test ArrayEndTimestampData + } + + /** + * Test the property 'endTimestamps' + */ + @Test + public void endTimestampsTest() { + // TODO: test endTimestamps + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoriteTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoriteTest.java new file mode 100644 index 0000000..8a659b0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoriteTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayFavorite + */ +public class ArrayFavoriteTest { + private final ArrayFavorite model = new ArrayFavorite(); + + /** + * Model tests for ArrayFavorite + */ + @Test + public void testArrayFavorite() { + // TODO: test ArrayFavorite + } + + /** + * Test the property 'arrayUuid' + */ + @Test + public void arrayUuidTest() { + // TODO: test arrayUuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesDataTest.java new file mode 100644 index 0000000..f4c8469 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayFavoritesDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayFavoritesData + */ +public class ArrayFavoritesDataTest { + private final ArrayFavoritesData model = new ArrayFavoritesData(); + + /** + * Model tests for ArrayFavoritesData + */ + @Test + public void testArrayFavoritesData() { + // TODO: test ArrayFavoritesData + } + + /** + * Test the property 'arrays' + */ + @Test + public void arraysTest() { + // TODO: test arrays + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoTest.java new file mode 100644 index 0000000..e9fd0d0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoTest.java @@ -0,0 +1,277 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.ArrayType; +import io.tiledb.cloud.rest_api.model.FileType; +import io.tiledb.cloud.rest_api.model.MetadataStringifiedEntry; +import io.tiledb.cloud.rest_api.model.Pricing; +import io.tiledb.cloud.rest_api.model.Subscription; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayInfo + */ +public class ArrayInfoTest { + private final ArrayInfo model = new ArrayInfo(); + + /** + * Model tests for ArrayInfo + */ + @Test + public void testArrayInfo() { + // TODO: test ArrayInfo + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'fileType' + */ + @Test + public void fileTypeTest() { + // TODO: test fileType + } + + /** + * Test the property 'fileProperties' + */ + @Test + public void filePropertiesTest() { + // TODO: test fileProperties + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'lastAccessed' + */ + @Test + public void lastAccessedTest() { + // TODO: test lastAccessed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'allowedActions' + */ + @Test + public void allowedActionsTest() { + // TODO: test allowedActions + } + + /** + * Test the property 'pricing' + */ + @Test + public void pricingTest() { + // TODO: test pricing + } + + /** + * Test the property 'subscriptions' + */ + @Test + public void subscriptionsTest() { + // TODO: test subscriptions + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'shareCount' + */ + @Test + public void shareCountTest() { + // TODO: test shareCount + } + + /** + * Test the property 'publicShare' + */ + @Test + public void publicShareTest() { + // TODO: test publicShare + } + + /** + * Test the property 'namespaceSubscribed' + */ + @Test + public void namespaceSubscribedTest() { + // TODO: test namespaceSubscribed + } + + /** + * Test the property 'tiledbUri' + */ + @Test + public void tiledbUriTest() { + // TODO: test tiledbUri + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + + /** + * Test the property 'readOnly' + */ + @Test + public void readOnlyTest() { + // TODO: test readOnly + } + + /** + * Test the property 'isFavorite' + */ + @Test + public void isFavoriteTest() { + // TODO: test isFavorite + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'createdBy' + */ + @Test + public void createdByTest() { + // TODO: test createdBy + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdateTest.java new file mode 100644 index 0000000..79ee001 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayInfoUpdateTest.java @@ -0,0 +1,134 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.FileType; +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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayInfoUpdate + */ +public class ArrayInfoUpdateTest { + private final ArrayInfoUpdate model = new ArrayInfoUpdate(); + + /** + * Model tests for ArrayInfoUpdate + */ + @Test + public void testArrayInfoUpdate() { + // TODO: test ArrayInfoUpdate + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'fileType' + */ + @Test + public void fileTypeTest() { + // TODO: test fileType + } + + /** + * Test the property 'fileProperties' + */ + @Test + public void filePropertiesTest() { + // TODO: test fileProperties + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + + /** + * Test the property 'readOnly' + */ + @Test + public void readOnlyTest() { + // TODO: test readOnly + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntryTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntryTest.java new file mode 100644 index 0000000..e39e7f2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataEntryTest.java @@ -0,0 +1,82 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayMetadataEntry + */ +public class ArrayMetadataEntryTest { + private final ArrayMetadataEntry model = new ArrayMetadataEntry(); + + /** + * Model tests for ArrayMetadataEntry + */ + @Test + public void testArrayMetadataEntry() { + // TODO: test ArrayMetadataEntry + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'valueNum' + */ + @Test + public void valueNumTest() { + // TODO: test valueNum + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'del' + */ + @Test + public void delTest() { + // TODO: test del + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataTest.java new file mode 100644 index 0000000..ac1eed3 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayMetadataTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayMetadataEntry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayMetadata + */ +public class ArrayMetadataTest { + private final ArrayMetadata model = new ArrayMetadata(); + + /** + * Model tests for ArrayMetadata + */ + @Test + public void testArrayMetadata() { + // TODO: test ArrayMetadata + } + + /** + * Test the property 'entries' + */ + @Test + public void entriesTest() { + // TODO: test entries + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArraySampleTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArraySampleTest.java new file mode 100644 index 0000000..f43176e --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArraySampleTest.java @@ -0,0 +1,48 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArraySample + */ +public class ArraySampleTest { + private final ArraySample model = new ArraySample(); + + /** + * Model tests for ArraySample + */ + @Test + public void testArraySample() { + // TODO: test ArraySample + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArraySchemaTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArraySchemaTest.java new file mode 100644 index 0000000..7a499d1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArraySchemaTest.java @@ -0,0 +1,135 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayType; +import io.tiledb.cloud.rest_api.model.Attribute; +import io.tiledb.cloud.rest_api.model.Domain; +import io.tiledb.cloud.rest_api.model.FilterPipeline; +import io.tiledb.cloud.rest_api.model.Layout; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArraySchema + */ +public class ArraySchemaTest { + private final ArraySchema model = new ArraySchema(); + + /** + * Model tests for ArraySchema + */ + @Test + public void testArraySchema() { + // TODO: test ArraySchema + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'arrayType' + */ + @Test + public void arrayTypeTest() { + // TODO: test arrayType + } + + /** + * Test the property 'tileOrder' + */ + @Test + public void tileOrderTest() { + // TODO: test tileOrder + } + + /** + * Test the property 'cellOrder' + */ + @Test + public void cellOrderTest() { + // TODO: test cellOrder + } + + /** + * Test the property 'capacity' + */ + @Test + public void capacityTest() { + // TODO: test capacity + } + + /** + * Test the property 'coordsFilterPipeline' + */ + @Test + public void coordsFilterPipelineTest() { + // TODO: test coordsFilterPipeline + } + + /** + * Test the property 'offsetFilterPipeline' + */ + @Test + public void offsetFilterPipelineTest() { + // TODO: test offsetFilterPipeline + } + + /** + * Test the property 'domain' + */ + @Test + public void domainTest() { + // TODO: test domain + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + + /** + * Test the property 'allowsDuplicates' + */ + @Test + public void allowsDuplicatesTest() { + // TODO: test allowsDuplicates + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArraySharingTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArraySharingTest.java new file mode 100644 index 0000000..60e03ce --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArraySharingTest.java @@ -0,0 +1,67 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArraySharing + */ +public class ArraySharingTest { + private final ArraySharing model = new ArraySharing(); + + /** + * Model tests for ArraySharing + */ + @Test + public void testArraySharing() { + // TODO: test ArraySharing + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'namespaceType' + */ + @Test + public void namespaceTypeTest() { + // TODO: test namespaceType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebarTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebarTest.java new file mode 100644 index 0000000..055a93f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskBrowserSidebarTest.java @@ -0,0 +1,66 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTaskBrowserSidebar + */ +public class ArrayTaskBrowserSidebarTest { + private final ArrayTaskBrowserSidebar model = new ArrayTaskBrowserSidebar(); + + /** + * Model tests for ArrayTaskBrowserSidebar + */ + @Test + public void testArrayTaskBrowserSidebar() { + // TODO: test ArrayTaskBrowserSidebar + } + + /** + * Test the property 'organizations' + */ + @Test + public void organizationsTest() { + // TODO: test organizations + } + + /** + * Test the property 'resultCountForAll' + */ + @Test + public void resultCountForAllTest() { + // TODO: test resultCountForAll + } + + /** + * Test the property 'resultCountByNamespace' + */ + @Test + public void resultCountByNamespaceTest() { + // TODO: test resultCountByNamespace + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskDataTest.java new file mode 100644 index 0000000..c9ca90a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayTask; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTaskData + */ +public class ArrayTaskDataTest { + private final ArrayTaskData model = new ArrayTaskData(); + + /** + * Model tests for ArrayTaskData + */ + @Test + public void testArrayTaskData() { + // TODO: test ArrayTaskData + } + + /** + * Test the property 'arrayTasks' + */ + @Test + public void arrayTasksTest() { + // TODO: test arrayTasks + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskLogTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskLogTest.java new file mode 100644 index 0000000..74b3aba --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskLogTest.java @@ -0,0 +1,56 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTaskLog + */ +public class ArrayTaskLogTest { + private final ArrayTaskLog model = new ArrayTaskLog(); + + /** + * Model tests for ArrayTaskLog + */ + @Test + public void testArrayTaskLog() { + // TODO: test ArrayTaskLog + } + + /** + * Test the property 'arrayTaskId' + */ + @Test + public void arrayTaskIdTest() { + // TODO: test arrayTaskId + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatusTest.java new file mode 100644 index 0000000..004e005 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskStatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTaskStatus + */ +public class ArrayTaskStatusTest { + /** + * Model tests for ArrayTaskStatus + */ + @Test + public void testArrayTaskStatus() { + // TODO: test ArrayTaskStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTest.java new file mode 100644 index 0000000..4c98798 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTest.java @@ -0,0 +1,300 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActivityLog; +import io.tiledb.cloud.rest_api.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.ArrayTaskStatus; +import io.tiledb.cloud.rest_api.model.ArrayTaskType; +import io.tiledb.cloud.rest_api.model.DomainArray; +import io.tiledb.cloud.rest_api.model.Querytype; +import io.tiledb.cloud.rest_api.model.ResultFormat; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTask + */ +public class ArrayTaskTest { + private final ArrayTask model = new ArrayTask(); + + /** + * Model tests for ArrayTask + */ + @Test + public void testArrayTask() { + // TODO: test ArrayTask + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'arrayMetadata' + */ + @Test + public void arrayMetadataTest() { + // TODO: test arrayMetadata + } + + /** + * Test the property 'subarray' + */ + @Test + public void subarrayTest() { + // TODO: test subarray + } + + /** + * Test the property 'memory' + */ + @Test + public void memoryTest() { + // TODO: test memory + } + + /** + * Test the property 'cpu' + */ + @Test + public void cpuTest() { + // TODO: test cpu + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'statusMessage' + */ + @Test + public void statusMessageTest() { + // TODO: test statusMessage + } + + /** + * Test the property 'startTime' + */ + @Test + public void startTimeTest() { + // TODO: test startTime + } + + /** + * Test the property 'finishTime' + */ + @Test + public void finishTimeTest() { + // TODO: test finishTime + } + + /** + * Test the property 'cost' + */ + @Test + public void costTest() { + // TODO: test cost + } + + /** + * Test the property 'egressCost' + */ + @Test + public void egressCostTest() { + // TODO: test egressCost + } + + /** + * Test the property 'accessCost' + */ + @Test + public void accessCostTest() { + // TODO: test accessCost + } + + /** + * Test the property 'queryType' + */ + @Test + public void queryTypeTest() { + // TODO: test queryType + } + + /** + * Test the property 'udfCode' + */ + @Test + public void udfCodeTest() { + // TODO: test udfCode + } + + /** + * Test the property 'udfLanguage' + */ + @Test + public void udfLanguageTest() { + // TODO: test udfLanguage + } + + /** + * Test the property 'sqlQuery' + */ + @Test + public void sqlQueryTest() { + // TODO: test sqlQuery + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'activity' + */ + @Test + public void activityTest() { + // TODO: test activity + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + + /** + * Test the property 'duration' + */ + @Test + public void durationTest() { + // TODO: test duration + } + + /** + * Test the property 'sqlInitCommands' + */ + @Test + public void sqlInitCommandsTest() { + // TODO: test sqlInitCommands + } + + /** + * Test the property 'sqlParameters' + */ + @Test + public void sqlParametersTest() { + // TODO: test sqlParameters + } + + /** + * Test the property 'resultFormat' + */ + @Test + public void resultFormatTest() { + // TODO: test resultFormat + } + + /** + * Test the property 'taskGraphUuid' + */ + @Test + public void taskGraphUuidTest() { + // TODO: test taskGraphUuid + } + + /** + * Test the property 'clientNodeUuid' + */ + @Test + public void clientNodeUuidTest() { + // TODO: test clientNodeUuid + } + + /** + * Test the property 'cloudProvider' + */ + @Test + public void cloudProviderTest() { + // TODO: test cloudProvider + } + + /** + * Test the property 'cloudRegion' + */ + @Test + public void cloudRegionTest() { + // TODO: test cloudRegion + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTypeTest.java new file mode 100644 index 0000000..f143782 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTaskTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTaskType + */ +public class ArrayTaskTypeTest { + /** + * Model tests for ArrayTaskType + */ + @Test + public void testArrayTaskType() { + // TODO: test ArrayTaskType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTest.java new file mode 100644 index 0000000..39dc993 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTest.java @@ -0,0 +1,66 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Querytype; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Array + */ +public class ArrayTest { + private final Array model = new Array(); + + /** + * Model tests for Array + */ + @Test + public void testArray() { + // TODO: test Array + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'queryType' + */ + @Test + public void queryTypeTest() { + // TODO: test queryType + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTypeTest.java new file mode 100644 index 0000000..5b9ac78 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayType + */ +public class ArrayTypeTest { + /** + * Model tests for ArrayType + */ + @Test + public void testArrayType() { + // TODO: test ArrayType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequestTest.java new file mode 100644 index 0000000..409b365 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ArrayVacuumRequestTest.java @@ -0,0 +1,49 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TileDBConfig; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayVacuumRequest + */ +public class ArrayVacuumRequestTest { + private final ArrayVacuumRequest model = new ArrayVacuumRequest(); + + /** + * Model tests for ArrayVacuumRequest + */ + @Test + public void testArrayVacuumRequest() { + // TODO: test ArrayVacuumRequest + } + + /** + * Test the property 'config' + */ + @Test + public void configTest() { + // TODO: test config + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AssetBackingTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AssetBackingTypeTest.java new file mode 100644 index 0000000..b3a8b62 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AssetBackingTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AssetBackingType + */ +public class AssetBackingTypeTest { + /** + * Model tests for AssetBackingType + */ + @Test + public void testAssetBackingType() { + // TODO: test AssetBackingType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AssetInfoTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AssetInfoTest.java new file mode 100644 index 0000000..edf175b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AssetInfoTest.java @@ -0,0 +1,125 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AssetBackingType; +import io.tiledb.cloud.rest_api.model.AssetOwnershipLevel; +import io.tiledb.cloud.rest_api.model.AssetType; +import io.tiledb.cloud.rest_api.model.MetadataStringified; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AssetInfo + */ +public class AssetInfoTest { + private final AssetInfo model = new AssetInfo(); + + /** + * Model tests for AssetInfo + */ + @Test + public void testAssetInfo() { + // TODO: test AssetInfo + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'assetType' + */ + @Test + public void assetTypeTest() { + // TODO: test assetType + } + + /** + * Test the property 'assetBackingType' + */ + @Test + public void assetBackingTypeTest() { + // TODO: test assetBackingType + } + + /** + * Test the property 'assetOwnershipLevel' + */ + @Test + public void assetOwnershipLevelTest() { + // TODO: test assetOwnershipLevel + } + + /** + * Test the property 'namespaceName' + */ + @Test + public void namespaceNameTest() { + // TODO: test namespaceName + } + + /** + * Test the property 'namespaceUuid' + */ + @Test + public void namespaceUuidTest() { + // TODO: test namespaceUuid + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'mimeType' + */ + @Test + public void mimeTypeTest() { + // TODO: test mimeType + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AssetListResponseTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AssetListResponseTest.java new file mode 100644 index 0000000..9ccd7fc --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AssetListResponseTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AssetInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AssetListResponse + */ +public class AssetListResponseTest { + private final AssetListResponse model = new AssetListResponse(); + + /** + * Model tests for AssetListResponse + */ + @Test + public void testAssetListResponse() { + // TODO: test AssetListResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AssetLocationsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AssetLocationsTest.java new file mode 100644 index 0000000..6a87d13 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AssetLocationsTest.java @@ -0,0 +1,97 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.StorageLocation; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AssetLocations + */ +public class AssetLocationsTest { + private final AssetLocations model = new AssetLocations(); + + /** + * Model tests for AssetLocations + */ + @Test + public void testAssetLocations() { + // TODO: test AssetLocations + } + + /** + * Test the property 'arrays' + */ + @Test + public void arraysTest() { + // TODO: test arrays + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + + /** + * Test the property 'groups' + */ + @Test + public void groupsTest() { + // TODO: test groups + } + + /** + * Test the property 'mlModels' + */ + @Test + public void mlModelsTest() { + // TODO: test mlModels + } + + /** + * Test the property 'notebooks' + */ + @Test + public void notebooksTest() { + // TODO: test notebooks + } + + /** + * Test the property 'taskGraphs' + */ + @Test + public void taskGraphsTest() { + // TODO: test taskGraphs + } + + /** + * Test the property 'udfs' + */ + @Test + public void udfsTest() { + // TODO: test udfs + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevelTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevelTest.java new file mode 100644 index 0000000..052e4e0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AssetOwnershipLevelTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AssetOwnershipLevel + */ +public class AssetOwnershipLevelTest { + /** + * Model tests for AssetOwnershipLevel + */ + @Test + public void testAssetOwnershipLevel() { + // TODO: test AssetOwnershipLevel + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AssetTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AssetTypeTest.java new file mode 100644 index 0000000..bfc01e1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AssetTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AssetType + */ +public class AssetTypeTest { + /** + * Model tests for AssetType + */ + @Test + public void testAssetType() { + // TODO: test AssetType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeaderTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeaderTest.java new file mode 100644 index 0000000..ca48749 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferHeaderTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AttributeBufferHeader + */ +public class AttributeBufferHeaderTest { + private final AttributeBufferHeader model = new AttributeBufferHeader(); + + /** + * Model tests for AttributeBufferHeader + */ + @Test + public void testAttributeBufferHeader() { + // TODO: test AttributeBufferHeader + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'fixedLenBufferSizeInBytes' + */ + @Test + public void fixedLenBufferSizeInBytesTest() { + // TODO: test fixedLenBufferSizeInBytes + } + + /** + * Test the property 'varLenBufferSizeInBytes' + */ + @Test + public void varLenBufferSizeInBytesTest() { + // TODO: test varLenBufferSizeInBytes + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferSizeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferSizeTest.java new file mode 100644 index 0000000..4b33244 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AttributeBufferSizeTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AttributeBufferSize + */ +public class AttributeBufferSizeTest { + private final AttributeBufferSize model = new AttributeBufferSize(); + + /** + * Model tests for AttributeBufferSize + */ + @Test + public void testAttributeBufferSize() { + // TODO: test AttributeBufferSize + } + + /** + * Test the property 'attribute' + */ + @Test + public void attributeTest() { + // TODO: test attribute + } + + /** + * Test the property 'offsetBytes' + */ + @Test + public void offsetBytesTest() { + // TODO: test offsetBytes + } + + /** + * Test the property 'dataBytes' + */ + @Test + public void dataBytesTest() { + // TODO: test dataBytes + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/AttributeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/AttributeTest.java new file mode 100644 index 0000000..b5d9c73 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/AttributeTest.java @@ -0,0 +1,92 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Datatype; +import io.tiledb.cloud.rest_api.model.FilterPipeline; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Attribute + */ +public class AttributeTest { + private final Attribute model = new Attribute(); + + /** + * Model tests for Attribute + */ + @Test + public void testAttribute() { + // TODO: test Attribute + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'filterPipeline' + */ + @Test + public void filterPipelineTest() { + // TODO: test filterPipeline + } + + /** + * Test the property 'cellValNum' + */ + @Test + public void cellValNumTest() { + // TODO: test cellValNum + } + + /** + * Test the property 'nullable' + */ + @Test + public void nullableTest() { + // TODO: test nullable + } + + /** + * Test the property 'fillValue' + */ + @Test + public void fillValueTest() { + // TODO: test fillValue + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/BackoffTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/BackoffTest.java new file mode 100644 index 0000000..1f417de --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/BackoffTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Backoff + */ +public class BackoffTest { + private final Backoff model = new Backoff(); + + /** + * Model tests for Backoff + */ + @Test + public void testBackoff() { + // TODO: test Backoff + } + + /** + * Test the property 'duration' + */ + @Test + public void durationTest() { + // TODO: test duration + } + + /** + * Test the property 'factor' + */ + @Test + public void factorTest() { + // TODO: test factor + } + + /** + * Test the property 'maxDuration' + */ + @Test + public void maxDurationTest() { + // TODO: test maxDuration + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequestTest.java new file mode 100644 index 0000000..efd5284 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ChangeAssetCredentialsRequestTest.java @@ -0,0 +1,58 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChangeAssetCredentialsRequest + */ +public class ChangeAssetCredentialsRequestTest { + private final ChangeAssetCredentialsRequest model = new ChangeAssetCredentialsRequest(); + + /** + * Model tests for ChangeAssetCredentialsRequest + */ + @Test + public void testChangeAssetCredentialsRequest() { + // TODO: test ChangeAssetCredentialsRequest + } + + /** + * Test the property 'accessCredentials' + */ + @Test + public void accessCredentialsTest() { + // TODO: test accessCredentials + } + + /** + * Test the property 'assetUuids' + */ + @Test + public void assetUuidsTest() { + // TODO: test assetUuids + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DatatypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DatatypeTest.java new file mode 100644 index 0000000..b7d431f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DatatypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Datatype + */ +public class DatatypeTest { + /** + * Model tests for Datatype + */ + @Test + public void testDatatype() { + // TODO: test Datatype + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DimensionCoordinateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DimensionCoordinateTest.java new file mode 100644 index 0000000..9a2917f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DimensionCoordinateTest.java @@ -0,0 +1,120 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DimensionCoordinate + */ +public class DimensionCoordinateTest { + private final DimensionCoordinate model = new DimensionCoordinate(); + + /** + * Model tests for DimensionCoordinate + */ + @Test + public void testDimensionCoordinate() { + // TODO: test DimensionCoordinate + } + + /** + * Test the property 'int8' + */ + @Test + public void int8Test() { + // TODO: test int8 + } + + /** + * Test the property 'uint8' + */ + @Test + public void uint8Test() { + // TODO: test uint8 + } + + /** + * Test the property 'int16' + */ + @Test + public void int16Test() { + // TODO: test int16 + } + + /** + * Test the property 'uint16' + */ + @Test + public void uint16Test() { + // TODO: test uint16 + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'uint32' + */ + @Test + public void uint32Test() { + // TODO: test uint32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'uint64' + */ + @Test + public void uint64Test() { + // TODO: test uint64 + } + + /** + * Test the property 'float32' + */ + @Test + public void float32Test() { + // TODO: test float32 + } + + /** + * Test the property 'float64' + */ + @Test + public void float64Test() { + // TODO: test float64 + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DimensionTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DimensionTest.java new file mode 100644 index 0000000..644f3f4 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DimensionTest.java @@ -0,0 +1,92 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Datatype; +import io.tiledb.cloud.rest_api.model.DimensionTileExtent; +import io.tiledb.cloud.rest_api.model.DomainArray; +import io.tiledb.cloud.rest_api.model.FilterPipeline; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dimension + */ +public class DimensionTest { + private final Dimension model = new Dimension(); + + /** + * Model tests for Dimension + */ + @Test + public void testDimension() { + // TODO: test Dimension + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'domain' + */ + @Test + public void domainTest() { + // TODO: test domain + } + + /** + * Test the property 'nullTileExtent' + */ + @Test + public void nullTileExtentTest() { + // TODO: test nullTileExtent + } + + /** + * Test the property 'tileExtent' + */ + @Test + public void tileExtentTest() { + // TODO: test tileExtent + } + + /** + * Test the property 'filterPipeline' + */ + @Test + public void filterPipelineTest() { + // TODO: test filterPipeline + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DimensionTileExtentTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DimensionTileExtentTest.java new file mode 100644 index 0000000..4aded6a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DimensionTileExtentTest.java @@ -0,0 +1,120 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DimensionTileExtent + */ +public class DimensionTileExtentTest { + private final DimensionTileExtent model = new DimensionTileExtent(); + + /** + * Model tests for DimensionTileExtent + */ + @Test + public void testDimensionTileExtent() { + // TODO: test DimensionTileExtent + } + + /** + * Test the property 'int8' + */ + @Test + public void int8Test() { + // TODO: test int8 + } + + /** + * Test the property 'uint8' + */ + @Test + public void uint8Test() { + // TODO: test uint8 + } + + /** + * Test the property 'int16' + */ + @Test + public void int16Test() { + // TODO: test int16 + } + + /** + * Test the property 'uint16' + */ + @Test + public void uint16Test() { + // TODO: test uint16 + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'uint32' + */ + @Test + public void uint32Test() { + // TODO: test uint32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'uint64' + */ + @Test + public void uint64Test() { + // TODO: test uint64 + } + + /** + * Test the property 'float32' + */ + @Test + public void float32Test() { + // TODO: test float32 + } + + /** + * Test the property 'float64' + */ + @Test + public void float64Test() { + // TODO: test float64 + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DomainArrayTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DomainArrayTest.java new file mode 100644 index 0000000..e376fac --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DomainArrayTest.java @@ -0,0 +1,122 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DomainArray + */ +public class DomainArrayTest { + private final DomainArray model = new DomainArray(); + + /** + * Model tests for DomainArray + */ + @Test + public void testDomainArray() { + // TODO: test DomainArray + } + + /** + * Test the property 'int8' + */ + @Test + public void int8Test() { + // TODO: test int8 + } + + /** + * Test the property 'uint8' + */ + @Test + public void uint8Test() { + // TODO: test uint8 + } + + /** + * Test the property 'int16' + */ + @Test + public void int16Test() { + // TODO: test int16 + } + + /** + * Test the property 'uint16' + */ + @Test + public void uint16Test() { + // TODO: test uint16 + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'uint32' + */ + @Test + public void uint32Test() { + // TODO: test uint32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'uint64' + */ + @Test + public void uint64Test() { + // TODO: test uint64 + } + + /** + * Test the property 'float32' + */ + @Test + public void float32Test() { + // TODO: test float32 + } + + /** + * Test the property 'float64' + */ + @Test + public void float64Test() { + // TODO: test float64 + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckResultTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckResultTest.java new file mode 100644 index 0000000..73ed1c7 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckResultTest.java @@ -0,0 +1,58 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.DomainCheckStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DomainCheckResult + */ +public class DomainCheckResultTest { + private final DomainCheckResult model = new DomainCheckResult(); + + /** + * Model tests for DomainCheckResult + */ + @Test + public void testDomainCheckResult() { + // TODO: test DomainCheckResult + } + + /** + * Test the property 'time' + */ + @Test + public void timeTest() { + // TODO: test time + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckStatusTest.java new file mode 100644 index 0000000..95060b0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DomainCheckStatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DomainCheckStatus + */ +public class DomainCheckStatusTest { + /** + * Model tests for DomainCheckStatus + */ + @Test + public void testDomainCheckStatus() { + // TODO: test DomainCheckStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DomainTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DomainTest.java new file mode 100644 index 0000000..acc0b4c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DomainTest.java @@ -0,0 +1,77 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Datatype; +import io.tiledb.cloud.rest_api.model.Dimension; +import io.tiledb.cloud.rest_api.model.Layout; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Domain + */ +public class DomainTest { + private final Domain model = new Domain(); + + /** + * Model tests for Domain + */ + @Test + public void testDomain() { + // TODO: test Domain + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'tileOrder' + */ + @Test + public void tileOrderTest() { + // TODO: test tileOrder + } + + /** + * Test the property 'cellOrder' + */ + @Test + public void cellOrderTest() { + // TODO: test cellOrder + } + + /** + * Test the property 'dimensions' + */ + @Test + public void dimensionsTest() { + // TODO: test dimensions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatusTest.java new file mode 100644 index 0000000..1868467 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/DomainVerificationStatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DomainVerificationStatus + */ +public class DomainVerificationStatusTest { + /** + * Model tests for DomainVerificationStatus + */ + @Test + public void testDomainVerificationStatus() { + // TODO: test DomainVerificationStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/EnumerationTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/EnumerationTest.java new file mode 100644 index 0000000..be83ac6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/EnumerationTest.java @@ -0,0 +1,98 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Enumeration + */ +public class EnumerationTest { + private final Enumeration model = new Enumeration(); + + /** + * Model tests for Enumeration + */ + @Test + public void testEnumeration() { + // TODO: test Enumeration + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'pathName' + */ + @Test + public void pathNameTest() { + // TODO: test pathName + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'cellValNum' + */ + @Test + public void cellValNumTest() { + // TODO: test cellValNum + } + + /** + * Test the property 'ordered' + */ + @Test + public void orderedTest() { + // TODO: test ordered + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'offsets' + */ + @Test + public void offsetsTest() { + // TODO: test offsets + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ErrorTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ErrorTest.java new file mode 100644 index 0000000..de698bf --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ErrorTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Error + */ +public class ErrorTest { + private final Error model = new Error(); + + /** + * Model tests for Error + */ + @Test + public void testError() { + // TODO: test Error + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'requestId' + */ + @Test + public void requestIdTest() { + // TODO: test requestId + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FileCreateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FileCreateTest.java new file mode 100644 index 0000000..baa4bfb --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FileCreateTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileCreate + */ +public class FileCreateTest { + private final FileCreate model = new FileCreate(); + + /** + * Model tests for FileCreate + */ + @Test + public void testFileCreate() { + // TODO: test FileCreate + } + + /** + * Test the property 'inputUri' + */ + @Test + public void inputUriTest() { + // TODO: test inputUri + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FileCreatedTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FileCreatedTest.java new file mode 100644 index 0000000..842fa0a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FileCreatedTest.java @@ -0,0 +1,56 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileCreated + */ +public class FileCreatedTest { + private final FileCreated model = new FileCreated(); + + /** + * Model tests for FileCreated + */ + @Test + public void testFileCreated() { + // TODO: test FileCreated + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'fileName' + */ + @Test + public void fileNameTest() { + // TODO: test fileName + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FileExportTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FileExportTest.java new file mode 100644 index 0000000..0a0a8e2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FileExportTest.java @@ -0,0 +1,48 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileExport + */ +public class FileExportTest { + private final FileExport model = new FileExport(); + + /** + * Model tests for FileExport + */ + @Test + public void testFileExport() { + // TODO: test FileExport + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FileExportedTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FileExportedTest.java new file mode 100644 index 0000000..c5d6d2b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FileExportedTest.java @@ -0,0 +1,48 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileExported + */ +public class FileExportedTest { + private final FileExported model = new FileExported(); + + /** + * Model tests for FileExported + */ + @Test + public void testFileExported() { + // TODO: test FileExported + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FilePropertyNameTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FilePropertyNameTest.java new file mode 100644 index 0000000..d90303c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FilePropertyNameTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FilePropertyName + */ +public class FilePropertyNameTest { + /** + * Model tests for FilePropertyName + */ + @Test + public void testFilePropertyName() { + // TODO: test FilePropertyName + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FileTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FileTypeTest.java new file mode 100644 index 0000000..df9ac86 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FileTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileType + */ +public class FileTypeTest { + /** + * Model tests for FileType + */ + @Test + public void testFileType() { + // TODO: test FileType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FileUploadedTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FileUploadedTest.java new file mode 100644 index 0000000..ac1aa1d --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FileUploadedTest.java @@ -0,0 +1,72 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileUploaded + */ +public class FileUploadedTest { + private final FileUploaded model = new FileUploaded(); + + /** + * Model tests for FileUploaded + */ + @Test + public void testFileUploaded() { + // TODO: test FileUploaded + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'fileName' + */ + @Test + public void fileNameTest() { + // TODO: test fileName + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FilterDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FilterDataTest.java new file mode 100644 index 0000000..a69e423 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FilterDataTest.java @@ -0,0 +1,120 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FilterData + */ +public class FilterDataTest { + private final FilterData model = new FilterData(); + + /** + * Model tests for FilterData + */ + @Test + public void testFilterData() { + // TODO: test FilterData + } + + /** + * Test the property 'int8' + */ + @Test + public void int8Test() { + // TODO: test int8 + } + + /** + * Test the property 'uint8' + */ + @Test + public void uint8Test() { + // TODO: test uint8 + } + + /** + * Test the property 'int16' + */ + @Test + public void int16Test() { + // TODO: test int16 + } + + /** + * Test the property 'uint16' + */ + @Test + public void uint16Test() { + // TODO: test uint16 + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'uint32' + */ + @Test + public void uint32Test() { + // TODO: test uint32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'uint64' + */ + @Test + public void uint64Test() { + // TODO: test uint64 + } + + /** + * Test the property 'float32' + */ + @Test + public void float32Test() { + // TODO: test float32 + } + + /** + * Test the property 'float64' + */ + @Test + public void float64Test() { + // TODO: test float64 + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FilterOptionTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FilterOptionTest.java new file mode 100644 index 0000000..c95b345 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FilterOptionTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FilterOption + */ +public class FilterOptionTest { + /** + * Model tests for FilterOption + */ + @Test + public void testFilterOption() { + // TODO: test FilterOption + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FilterPipelineTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FilterPipelineTest.java new file mode 100644 index 0000000..2972b54 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FilterPipelineTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Filter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FilterPipeline + */ +public class FilterPipelineTest { + private final FilterPipeline model = new FilterPipeline(); + + /** + * Model tests for FilterPipeline + */ + @Test + public void testFilterPipeline() { + // TODO: test FilterPipeline + } + + /** + * Test the property 'filters' + */ + @Test + public void filtersTest() { + // TODO: test filters + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FilterTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FilterTest.java new file mode 100644 index 0000000..718f594 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FilterTest.java @@ -0,0 +1,58 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.FilterData; +import io.tiledb.cloud.rest_api.model.FilterType; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Filter + */ +public class FilterTest { + private final Filter model = new Filter(); + + /** + * Model tests for Filter + */ + @Test + public void testFilter() { + // TODO: test Filter + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FilterTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FilterTypeTest.java new file mode 100644 index 0000000..8b5d733 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FilterTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FilterType + */ +public class FilterTypeTest { + /** + * Model tests for FilterType + */ + @Test + public void testFilterType() { + // TODO: test FilterType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequestTest.java new file mode 100644 index 0000000..d14b2ec --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoRequestTest.java @@ -0,0 +1,49 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TileDBConfig; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FragmentInfoRequest + */ +public class FragmentInfoRequestTest { + private final FragmentInfoRequest model = new FragmentInfoRequest(); + + /** + * Model tests for FragmentInfoRequest + */ + @Test + public void testFragmentInfoRequest() { + // TODO: test FragmentInfoRequest + } + + /** + * Test the property 'config' + */ + @Test + public void configTest() { + // TODO: test config + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoTest.java new file mode 100644 index 0000000..b5c3256 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FragmentInfoTest.java @@ -0,0 +1,70 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArraySchema; +import io.tiledb.cloud.rest_api.model.SingleFragmentInfo; +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FragmentInfo + */ +public class FragmentInfoTest { + private final FragmentInfo model = new FragmentInfo(); + + /** + * Model tests for FragmentInfo + */ + @Test + public void testFragmentInfo() { + // TODO: test FragmentInfo + } + + /** + * Test the property 'arraySchemaAll' + */ + @Test + public void arraySchemaAllTest() { + // TODO: test arraySchemaAll + } + + /** + * Test the property 'fragmentInfo' + */ + @Test + public void fragmentInfoTest() { + // TODO: test fragmentInfo + } + + /** + * Test the property 'toVacuum' + */ + @Test + public void toVacuumTest() { + // TODO: test toVacuum + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/FragmentMetadataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/FragmentMetadataTest.java new file mode 100644 index 0000000..d8524c4 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/FragmentMetadataTest.java @@ -0,0 +1,242 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FragmentMetadata + */ +public class FragmentMetadataTest { + private final FragmentMetadata model = new FragmentMetadata(); + + /** + * Model tests for FragmentMetadata + */ + @Test + public void testFragmentMetadata() { + // TODO: test FragmentMetadata + } + + /** + * Test the property 'fileSizes' + */ + @Test + public void fileSizesTest() { + // TODO: test fileSizes + } + + /** + * Test the property 'fileVarSizes' + */ + @Test + public void fileVarSizesTest() { + // TODO: test fileVarSizes + } + + /** + * Test the property 'fileValiditySizes' + */ + @Test + public void fileValiditySizesTest() { + // TODO: test fileValiditySizes + } + + /** + * Test the property 'fragmentUri' + */ + @Test + public void fragmentUriTest() { + // TODO: test fragmentUri + } + + /** + * Test the property 'hasTimestamps' + */ + @Test + public void hasTimestampsTest() { + // TODO: test hasTimestamps + } + + /** + * Test the property 'hasDeleteMeta' + */ + @Test + public void hasDeleteMetaTest() { + // TODO: test hasDeleteMeta + } + + /** + * Test the property 'sparseTileNum' + */ + @Test + public void sparseTileNumTest() { + // TODO: test sparseTileNum + } + + /** + * Test the property 'tileIndexBase' + */ + @Test + public void tileIndexBaseTest() { + // TODO: test tileIndexBase + } + + /** + * Test the property 'tileOffsets' + */ + @Test + public void tileOffsetsTest() { + // TODO: test tileOffsets + } + + /** + * Test the property 'tileVarOffsets' + */ + @Test + public void tileVarOffsetsTest() { + // TODO: test tileVarOffsets + } + + /** + * Test the property 'tileVarSizes' + */ + @Test + public void tileVarSizesTest() { + // TODO: test tileVarSizes + } + + /** + * Test the property 'tileValidityOffsets' + */ + @Test + public void tileValidityOffsetsTest() { + // TODO: test tileValidityOffsets + } + + /** + * Test the property 'tileMinBuffer' + */ + @Test + public void tileMinBufferTest() { + // TODO: test tileMinBuffer + } + + /** + * Test the property 'tileMinVarBuffer' + */ + @Test + public void tileMinVarBufferTest() { + // TODO: test tileMinVarBuffer + } + + /** + * Test the property 'tileMaxBuffer' + */ + @Test + public void tileMaxBufferTest() { + // TODO: test tileMaxBuffer + } + + /** + * Test the property 'tileMaxVarBuffer' + */ + @Test + public void tileMaxVarBufferTest() { + // TODO: test tileMaxVarBuffer + } + + /** + * Test the property 'tileSums' + */ + @Test + public void tileSumsTest() { + // TODO: test tileSums + } + + /** + * Test the property 'tileNullCounts' + */ + @Test + public void tileNullCountsTest() { + // TODO: test tileNullCounts + } + + /** + * Test the property 'fragmentMins' + */ + @Test + public void fragmentMinsTest() { + // TODO: test fragmentMins + } + + /** + * Test the property 'fragmentMaxs' + */ + @Test + public void fragmentMaxsTest() { + // TODO: test fragmentMaxs + } + + /** + * Test the property 'fragmentSums' + */ + @Test + public void fragmentSumsTest() { + // TODO: test fragmentSums + } + + /** + * Test the property 'fragmentNullCounts' + */ + @Test + public void fragmentNullCountsTest() { + // TODO: test fragmentNullCounts + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'timestampRange' + */ + @Test + public void timestampRangeTest() { + // TODO: test timestampRange + } + + /** + * Test the property 'lastTileCellNum' + */ + @Test + public void lastTileCellNumTest() { + // TODO: test lastTileCellNum + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GenericUDFTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GenericUDFTest.java new file mode 100644 index 0000000..0053d36 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GenericUDFTest.java @@ -0,0 +1,180 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ResultFormat; +import io.tiledb.cloud.rest_api.model.UDFLanguage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GenericUDF + */ +public class GenericUDFTest { + private final GenericUDF model = new GenericUDF(); + + /** + * Model tests for GenericUDF + */ + @Test + public void testGenericUDF() { + // TODO: test GenericUDF + } + + /** + * Test the property 'udfInfoName' + */ + @Test + public void udfInfoNameTest() { + // TODO: test udfInfoName + } + + /** + * Test the property 'language' + */ + @Test + public void languageTest() { + // TODO: test language + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'imageName' + */ + @Test + public void imageNameTest() { + // TODO: test imageName + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'resourceClass' + */ + @Test + public void resourceClassTest() { + // TODO: test resourceClass + } + + /** + * Test the property 'exec' + */ + @Test + public void execTest() { + // TODO: test exec + } + + /** + * Test the property 'execRaw' + */ + @Test + public void execRawTest() { + // TODO: test execRaw + } + + /** + * Test the property 'argument' + */ + @Test + public void argumentTest() { + // TODO: test argument + } + + /** + * Test the property 'storedParamUuids' + */ + @Test + public void storedParamUuidsTest() { + // TODO: test storedParamUuids + } + + /** + * Test the property 'resultFormat' + */ + @Test + public void resultFormatTest() { + // TODO: test resultFormat + } + + /** + * Test the property 'taskName' + */ + @Test + public void taskNameTest() { + // TODO: test taskName + } + + /** + * Test the property 'storeResults' + */ + @Test + public void storeResultsTest() { + // TODO: test storeResults + } + + /** + * Test the property 'timeout' + */ + @Test + public void timeoutTest() { + // TODO: test timeout + } + + /** + * Test the property 'dontDownloadResults' + */ + @Test + public void dontDownloadResultsTest() { + // TODO: test dontDownloadResults + } + + /** + * Test the property 'taskGraphUuid' + */ + @Test + public void taskGraphUuidTest() { + // TODO: test taskGraphUuid + } + + /** + * Test the property 'clientNodeUuid' + */ + @Test + public void clientNodeUuidTest() { + // TODO: test clientNodeUuid + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200ResponseTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200ResponseTest.java new file mode 100644 index 0000000..6066461 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GetTiledbStats200ResponseTest.java @@ -0,0 +1,48 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GetTiledbStats200Response + */ +public class GetTiledbStats200ResponseTest { + private final GetTiledbStats200Response model = new GetTiledbStats200Response(); + + /** + * Model tests for GetTiledbStats200Response + */ + @Test + public void testGetTiledbStats200Response() { + // TODO: test GetTiledbStats200Response + } + + /** + * Test the property 'stats' + */ + @Test + public void statsTest() { + // TODO: test stats + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupActionsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupActionsTest.java new file mode 100644 index 0000000..a2e8020 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupActionsTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupActions + */ +public class GroupActionsTest { + /** + * Model tests for GroupActions + */ + @Test + public void testGroupActions() { + // TODO: test GroupActions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserDataTest.java new file mode 100644 index 0000000..e0d1a14 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupBrowserData + */ +public class GroupBrowserDataTest { + private final GroupBrowserData model = new GroupBrowserData(); + + /** + * Model tests for GroupBrowserData + */ + @Test + public void testGroupBrowserData() { + // TODO: test GroupBrowserData + } + + /** + * Test the property 'groups' + */ + @Test + public void groupsTest() { + // TODO: test groups + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterDataTest.java new file mode 100644 index 0000000..977d7e8 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupBrowserFilterDataTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupType; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupBrowserFilterData + */ +public class GroupBrowserFilterDataTest { + private final GroupBrowserFilterData model = new GroupBrowserFilterData(); + + /** + * Model tests for GroupBrowserFilterData + */ + @Test + public void testGroupBrowserFilterData() { + // TODO: test GroupBrowserFilterData + } + + /** + * Test the property 'namespaces' + */ + @Test + public void namespacesTest() { + // TODO: test namespaces + } + + /** + * Test the property 'groupTypes' + */ + @Test + public void groupTypesTest() { + // TODO: test groupTypes + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupChangesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupChangesTest.java new file mode 100644 index 0000000..300a33c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupChangesTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupMember; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupChanges + */ +public class GroupChangesTest { + private final GroupChanges model = new GroupChanges(); + + /** + * Model tests for GroupChanges + */ + @Test + public void testGroupChanges() { + // TODO: test GroupChanges + } + + /** + * Test the property 'add' + */ + @Test + public void addTest() { + // TODO: test add + } + + /** + * Test the property 'remove' + */ + @Test + public void removeTest() { + // TODO: test remove + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAssetTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAssetTest.java new file mode 100644 index 0000000..0b014b6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityAssetTest.java @@ -0,0 +1,73 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AssetType; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupContentActivityAsset + */ +public class GroupContentActivityAssetTest { + private final GroupContentActivityAsset model = new GroupContentActivityAsset(); + + /** + * Model tests for GroupContentActivityAsset + */ + @Test + public void testGroupContentActivityAsset() { + // TODO: test GroupContentActivityAsset + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'assetType' + */ + @Test + public void assetTypeTest() { + // TODO: test assetType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponseTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponseTest.java new file mode 100644 index 0000000..24ecdca --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityResponseTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupContentActivity; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupContentActivityResponse + */ +public class GroupContentActivityResponseTest { + private final GroupContentActivityResponse model = new GroupContentActivityResponse(); + + /** + * Model tests for GroupContentActivityResponse + */ + @Test + public void testGroupContentActivityResponse() { + // TODO: test GroupContentActivityResponse + } + + /** + * Test the property 'activity' + */ + @Test + public void activityTest() { + // TODO: test activity + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityTest.java new file mode 100644 index 0000000..61b4f81 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentActivityTest.java @@ -0,0 +1,58 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActivityLog; +import io.tiledb.cloud.rest_api.model.GroupContentActivityAsset; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupContentActivity + */ +public class GroupContentActivityTest { + private final GroupContentActivity model = new GroupContentActivity(); + + /** + * Model tests for GroupContentActivity + */ + @Test + public void testGroupContentActivity() { + // TODO: test GroupContentActivity + } + + /** + * Test the property 'asset' + */ + @Test + public void assetTest() { + // TODO: test asset + } + + /** + * Test the property 'activityLog' + */ + @Test + public void activityLogTest() { + // TODO: test activityLog + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterDataTest.java new file mode 100644 index 0000000..f07ffcf --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsFilterDataTest.java @@ -0,0 +1,50 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupContentsFilterData + */ +public class GroupContentsFilterDataTest { + private final GroupContentsFilterData model = new GroupContentsFilterData(); + + /** + * Model tests for GroupContentsFilterData + */ + @Test + public void testGroupContentsFilterData() { + // TODO: test GroupContentsFilterData + } + + /** + * Test the property 'namespaces' + */ + @Test + public void namespacesTest() { + // TODO: test namespaces + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsTest.java new file mode 100644 index 0000000..7616644 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupContentsTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupEntry; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupContents + */ +public class GroupContentsTest { + private final GroupContents model = new GroupContents(); + + /** + * Model tests for GroupContents + */ + @Test + public void testGroupContents() { + // TODO: test GroupContents + } + + /** + * Test the property 'entries' + */ + @Test + public void entriesTest() { + // TODO: test entries + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupCreateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupCreateTest.java new file mode 100644 index 0000000..e0b5c64 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupCreateTest.java @@ -0,0 +1,114 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupCreate + */ +public class GroupCreateTest { + private final GroupCreate model = new GroupCreate(); + + /** + * Model tests for GroupCreate + */ + @Test + public void testGroupCreate() { + // TODO: test GroupCreate + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'parent' + */ + @Test + public void parentTest() { + // TODO: test parent + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupEntryTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupEntryTest.java new file mode 100644 index 0000000..214560c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupEntryTest.java @@ -0,0 +1,66 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.GroupInfo; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupEntry + */ +public class GroupEntryTest { + private final GroupEntry model = new GroupEntry(); + + /** + * Model tests for GroupEntry + */ + @Test + public void testGroupEntry() { + // TODO: test GroupEntry + } + + /** + * Test the property 'memberId' + */ + @Test + public void memberIdTest() { + // TODO: test memberId + } + + /** + * Test the property 'group' + */ + @Test + public void groupTest() { + // TODO: test group + } + + /** + * Test the property 'array' + */ + @Test + public void arrayTest() { + // TODO: test array + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupInfoTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupInfoTest.java new file mode 100644 index 0000000..71aac99 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupInfoTest.java @@ -0,0 +1,224 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupActions; +import io.tiledb.cloud.rest_api.model.GroupType; +import io.tiledb.cloud.rest_api.model.MetadataStringifiedEntry; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupInfo + */ +public class GroupInfoTest { + private final GroupInfo model = new GroupInfo(); + + /** + * Model tests for GroupInfo + */ + @Test + public void testGroupInfo() { + // TODO: test GroupInfo + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'tiledbUri' + */ + @Test + public void tiledbUriTest() { + // TODO: test tiledbUri + } + + /** + * Test the property 'assetCount' + */ + @Test + public void assetCountTest() { + // TODO: test assetCount + } + + /** + * Test the property 'groupCount' + */ + @Test + public void groupCountTest() { + // TODO: test groupCount + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'lastAccessed' + */ + @Test + public void lastAccessedTest() { + // TODO: test lastAccessed + } + + /** + * Test the property 'allowedActions' + */ + @Test + public void allowedActionsTest() { + // TODO: test allowedActions + } + + /** + * Test the property 'groupType' + */ + @Test + public void groupTypeTest() { + // TODO: test groupType + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'shareCount' + */ + @Test + public void shareCountTest() { + // TODO: test shareCount + } + + /** + * Test the property 'publicShare' + */ + @Test + public void publicShareTest() { + // TODO: test publicShare + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'createdBy' + */ + @Test + public void createdByTest() { + // TODO: test createdBy + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetTypeTest.java new file mode 100644 index 0000000..3f5d99e --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberAssetTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupMemberAssetType + */ +public class GroupMemberAssetTypeTest { + /** + * Model tests for GroupMemberAssetType + */ + @Test + public void testGroupMemberAssetType() { + // TODO: test GroupMemberAssetType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTest.java new file mode 100644 index 0000000..2922b50 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTest.java @@ -0,0 +1,65 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.GroupMemberType; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupMember + */ +public class GroupMemberTest { + private final GroupMember model = new GroupMember(); + + /** + * Model tests for GroupMember + */ + @Test + public void testGroupMember() { + // TODO: test GroupMember + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'memberType' + */ + @Test + public void memberTypeTest() { + // TODO: test memberType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTypeTest.java new file mode 100644 index 0000000..5ef9878 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupMemberTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupMemberType + */ +public class GroupMemberTypeTest { + /** + * Model tests for GroupMemberType + */ + @Test + public void testGroupMemberType() { + // TODO: test GroupMemberType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupRegisterTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupRegisterTest.java new file mode 100644 index 0000000..d6aa184 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupRegisterTest.java @@ -0,0 +1,114 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupRegister + */ +public class GroupRegisterTest { + private final GroupRegister model = new GroupRegister(); + + /** + * Model tests for GroupRegister + */ + @Test + public void testGroupRegister() { + // TODO: test GroupRegister + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'parent' + */ + @Test + public void parentTest() { + // TODO: test parent + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingRequestTest.java new file mode 100644 index 0000000..b75d8d3 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingRequestTest.java @@ -0,0 +1,68 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.GroupActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupSharingRequest + */ +public class GroupSharingRequestTest { + private final GroupSharingRequest model = new GroupSharingRequest(); + + /** + * Model tests for GroupSharingRequest + */ + @Test + public void testGroupSharingRequest() { + // TODO: test GroupSharingRequest + } + + /** + * Test the property 'groupActions' + */ + @Test + public void groupActionsTest() { + // TODO: test groupActions + } + + /** + * Test the property 'arrayActions' + */ + @Test + public void arrayActionsTest() { + // TODO: test arrayActions + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingTest.java new file mode 100644 index 0000000..a70d42d --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupSharingTest.java @@ -0,0 +1,76 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.GroupActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupSharing + */ +public class GroupSharingTest { + private final GroupSharing model = new GroupSharing(); + + /** + * Model tests for GroupSharing + */ + @Test + public void testGroupSharing() { + // TODO: test GroupSharing + } + + /** + * Test the property 'groupActions' + */ + @Test + public void groupActionsTest() { + // TODO: test groupActions + } + + /** + * Test the property 'arrayActions' + */ + @Test + public void arrayActionsTest() { + // TODO: test arrayActions + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'namespaceType' + */ + @Test + public void namespaceTypeTest() { + // TODO: test namespaceType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKeyTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKeyTest.java new file mode 100644 index 0000000..9333cf6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeMetadataKeyTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupTypeMetadataKey + */ +public class GroupTypeMetadataKeyTest { + /** + * Model tests for GroupTypeMetadataKey + */ + @Test + public void testGroupTypeMetadataKey() { + // TODO: test GroupTypeMetadataKey + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeTest.java new file mode 100644 index 0000000..527453f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupType + */ +public class GroupTypeTest { + /** + * Model tests for GroupType + */ + @Test + public void testGroupType() { + // TODO: test GroupType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/GroupUpdateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/GroupUpdateTest.java new file mode 100644 index 0000000..c0d9c29 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/GroupUpdateTest.java @@ -0,0 +1,99 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GroupUpdate + */ +public class GroupUpdateTest { + private final GroupUpdate model = new GroupUpdate(); + + /** + * Model tests for GroupUpdate + */ + @Test + public void testGroupUpdate() { + // TODO: test GroupUpdate + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmailTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmailTest.java new file mode 100644 index 0000000..577a29c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationArrayShareEmailTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationArrayShareEmail + */ +public class InvitationArrayShareEmailTest { + private final InvitationArrayShareEmail model = new InvitationArrayShareEmail(); + + /** + * Model tests for InvitationArrayShareEmail + */ + @Test + public void testInvitationArrayShareEmail() { + // TODO: test InvitationArrayShareEmail + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'inviteeEmail' + */ + @Test + public void inviteeEmailTest() { + // TODO: test inviteeEmail + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationDataTest.java new file mode 100644 index 0000000..1f73c80 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Invitation; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationData + */ +public class InvitationDataTest { + private final InvitationData model = new InvitationData(); + + /** + * Model tests for InvitationData + */ + @Test + public void testInvitationData() { + // TODO: test InvitationData + } + + /** + * Test the property 'invitations' + */ + @Test + public void invitationsTest() { + // TODO: test invitations + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipientsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipientsTest.java new file mode 100644 index 0000000..35addfd --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationFailedRecipientsTest.java @@ -0,0 +1,50 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationFailedRecipients + */ +public class InvitationFailedRecipientsTest { + private final InvitationFailedRecipients model = new InvitationFailedRecipients(); + + /** + * Model tests for InvitationFailedRecipients + */ + @Test + public void testInvitationFailedRecipients() { + // TODO: test InvitationFailedRecipients + } + + /** + * Test the property 'failedRecipients' + */ + @Test + public void failedRecipientsTest() { + // TODO: test failedRecipients + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmailTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmailTest.java new file mode 100644 index 0000000..7df4576 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationGroupShareEmailTest.java @@ -0,0 +1,68 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayActions; +import io.tiledb.cloud.rest_api.model.GroupActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationGroupShareEmail + */ +public class InvitationGroupShareEmailTest { + private final InvitationGroupShareEmail model = new InvitationGroupShareEmail(); + + /** + * Model tests for InvitationGroupShareEmail + */ + @Test + public void testInvitationGroupShareEmail() { + // TODO: test InvitationGroupShareEmail + } + + /** + * Test the property 'arrayActions' + */ + @Test + public void arrayActionsTest() { + // TODO: test arrayActions + } + + /** + * Test the property 'groupActions' + */ + @Test + public void groupActionsTest() { + // TODO: test groupActions + } + + /** + * Test the property 'inviteeEmailOrName' + */ + @Test + public void inviteeEmailOrNameTest() { + // TODO: test inviteeEmailOrName + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmailTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmailTest.java new file mode 100644 index 0000000..0578631 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationOrganizationJoinEmailTest.java @@ -0,0 +1,68 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationOrganizationJoinEmail + */ +public class InvitationOrganizationJoinEmailTest { + private final InvitationOrganizationJoinEmail model = new InvitationOrganizationJoinEmail(); + + /** + * Model tests for InvitationOrganizationJoinEmail + */ + @Test + public void testInvitationOrganizationJoinEmail() { + // TODO: test InvitationOrganizationJoinEmail + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'organizationRole' + */ + @Test + public void organizationRoleTest() { + // TODO: test organizationRole + } + + /** + * Test the property 'inviteeEmail' + */ + @Test + public void inviteeEmailTest() { + // TODO: test inviteeEmail + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationStatusTest.java new file mode 100644 index 0000000..3db4ca7 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationStatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationStatus + */ +public class InvitationStatusTest { + /** + * Model tests for InvitationStatus + */ + @Test + public void testInvitationStatus() { + // TODO: test InvitationStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationTest.java new file mode 100644 index 0000000..716fb18 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationTest.java @@ -0,0 +1,204 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.InvitationStatus; +import io.tiledb.cloud.rest_api.model.InvitationType; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Invitation + */ +public class InvitationTest { + private final Invitation model = new Invitation(); + + /** + * Model tests for Invitation + */ + @Test + public void testInvitation() { + // TODO: test Invitation + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'invitationType' + */ + @Test + public void invitationTypeTest() { + // TODO: test invitationType + } + + /** + * Test the property 'ownerNamespaceUuid' + */ + @Test + public void ownerNamespaceUuidTest() { + // TODO: test ownerNamespaceUuid + } + + /** + * Test the property 'inviterUuid' + */ + @Test + public void inviterUuidTest() { + // TODO: test inviterUuid + } + + /** + * Test the property 'userNamespaceUuid' + */ + @Test + public void userNamespaceUuidTest() { + // TODO: test userNamespaceUuid + } + + /** + * Test the property 'organizationUserUuid' + */ + @Test + public void organizationUserUuidTest() { + // TODO: test organizationUserUuid + } + + /** + * Test the property 'organizationName' + */ + @Test + public void organizationNameTest() { + // TODO: test organizationName + } + + /** + * Test the property 'organizationRole' + */ + @Test + public void organizationRoleTest() { + // TODO: test organizationRole + } + + /** + * Test the property 'organizationUuid' + */ + @Test + public void organizationUuidTest() { + // TODO: test organizationUuid + } + + /** + * Test the property 'arrayUuid' + */ + @Test + public void arrayUuidTest() { + // TODO: test arrayUuid + } + + /** + * Test the property 'groupUuid' + */ + @Test + public void groupUuidTest() { + // TODO: test groupUuid + } + + /** + * Test the property 'arrayName' + */ + @Test + public void arrayNameTest() { + // TODO: test arrayName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'groupActions' + */ + @Test + public void groupActionsTest() { + // TODO: test groupActions + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + + /** + * Test the property 'acceptedAt' + */ + @Test + public void acceptedAtTest() { + // TODO: test acceptedAt + } + + /** + * Test the property 'namespaceInvited' + */ + @Test + public void namespaceInvitedTest() { + // TODO: test namespaceInvited + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/InvitationTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationTypeTest.java new file mode 100644 index 0000000..67d5d98 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/InvitationTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for InvitationType + */ +public class InvitationTypeTest { + /** + * Model tests for InvitationType + */ + @Test + public void testInvitationType() { + // TODO: test InvitationType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/LastAccessedArrayTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/LastAccessedArrayTest.java new file mode 100644 index 0000000..8d318b7 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/LastAccessedArrayTest.java @@ -0,0 +1,82 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ActivityEventType; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LastAccessedArray + */ +public class LastAccessedArrayTest { + private final LastAccessedArray model = new LastAccessedArray(); + + /** + * Model tests for LastAccessedArray + */ + @Test + public void testLastAccessedArray() { + // TODO: test LastAccessedArray + } + + /** + * Test the property 'arrayId' + */ + @Test + public void arrayIdTest() { + // TODO: test arrayId + } + + /** + * Test the property 'arrayName' + */ + @Test + public void arrayNameTest() { + // TODO: test arrayName + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'accessedTime' + */ + @Test + public void accessedTimeTest() { + // TODO: test accessedTime + } + + /** + * Test the property 'accessType' + */ + @Test + public void accessTypeTest() { + // TODO: test accessType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/LayoutTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/LayoutTest.java new file mode 100644 index 0000000..1fabaa4 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/LayoutTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Layout + */ +public class LayoutTest { + /** + * Model tests for Layout + */ + @Test + public void testLayout() { + // TODO: test Layout + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequestTest.java new file mode 100644 index 0000000..f396523 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaRequestTest.java @@ -0,0 +1,49 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TileDBConfig; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LoadArraySchemaRequest + */ +public class LoadArraySchemaRequestTest { + private final LoadArraySchemaRequest model = new LoadArraySchemaRequest(); + + /** + * Model tests for LoadArraySchemaRequest + */ + @Test + public void testLoadArraySchemaRequest() { + // TODO: test LoadArraySchemaRequest + } + + /** + * Test the property 'config' + */ + @Test + public void configTest() { + // TODO: test config + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponseTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponseTest.java new file mode 100644 index 0000000..663cb7f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/LoadArraySchemaResponseTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArraySchema; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LoadArraySchemaResponse + */ +public class LoadArraySchemaResponseTest { + private final LoadArraySchemaResponse model = new LoadArraySchemaResponse(); + + /** + * Model tests for LoadArraySchemaResponse + */ + @Test + public void testLoadArraySchemaResponse() { + // TODO: test LoadArraySchemaResponse + } + + /** + * Test the property 'latestArraySchema' + */ + @Test + public void latestArraySchemaTest() { + // TODO: test latestArraySchema + } + + /** + * Test the property 'allArraySchemas' + */ + @Test + public void allArraySchemasTest() { + // TODO: test allArraySchemas + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequestTest.java new file mode 100644 index 0000000..9a6192e --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsRequestTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TileDBConfig; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LoadEnumerationsRequest + */ +public class LoadEnumerationsRequestTest { + private final LoadEnumerationsRequest model = new LoadEnumerationsRequest(); + + /** + * Model tests for LoadEnumerationsRequest + */ + @Test + public void testLoadEnumerationsRequest() { + // TODO: test LoadEnumerationsRequest + } + + /** + * Test the property 'config' + */ + @Test + public void configTest() { + // TODO: test config + } + + /** + * Test the property 'enumerations' + */ + @Test + public void enumerationsTest() { + // TODO: test enumerations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponseTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponseTest.java new file mode 100644 index 0000000..cbb0ea6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/LoadEnumerationsResponseTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Enumeration; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for LoadEnumerationsResponse + */ +public class LoadEnumerationsResponseTest { + private final LoadEnumerationsResponse model = new LoadEnumerationsResponse(); + + /** + * Model tests for LoadEnumerationsResponse + */ + @Test + public void testLoadEnumerationsResponse() { + // TODO: test LoadEnumerationsResponse + } + + /** + * Test the property 'enumerations' + */ + @Test + public void enumerationsTest() { + // TODO: test enumerations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoriteTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoriteTest.java new file mode 100644 index 0000000..129ca69 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoriteTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MLModelFavorite + */ +public class MLModelFavoriteTest { + private final MLModelFavorite model = new MLModelFavorite(); + + /** + * Model tests for MLModelFavorite + */ + @Test + public void testMLModelFavorite() { + // TODO: test MLModelFavorite + } + + /** + * Test the property 'mlmodelUuid' + */ + @Test + public void mlmodelUuidTest() { + // TODO: test mlmodelUuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesDataTest.java new file mode 100644 index 0000000..f6dd647 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/MLModelFavoritesDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MLModelFavoritesData + */ +public class MLModelFavoritesDataTest { + private final MLModelFavoritesData model = new MLModelFavoritesData(); + + /** + * Model tests for MLModelFavoritesData + */ + @Test + public void testMLModelFavoritesData() { + // TODO: test MLModelFavoritesData + } + + /** + * Test the property 'mlmodels' + */ + @Test + public void mlmodelsTest() { + // TODO: test mlmodels + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/MaxBufferSizesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/MaxBufferSizesTest.java new file mode 100644 index 0000000..bb10442 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/MaxBufferSizesTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AttributeBufferSize; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MaxBufferSizes + */ +public class MaxBufferSizesTest { + private final MaxBufferSizes model = new MaxBufferSizes(); + + /** + * Model tests for MaxBufferSizes + */ + @Test + public void testMaxBufferSizes() { + // TODO: test MaxBufferSizes + } + + /** + * Test the property 'maxBufferSizes' + */ + @Test + public void maxBufferSizesTest() { + // TODO: test maxBufferSizes + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntryTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntryTest.java new file mode 100644 index 0000000..958e4e2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedEntryTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MetadataStringifiedEntry + */ +public class MetadataStringifiedEntryTest { + private final MetadataStringifiedEntry model = new MetadataStringifiedEntry(); + + /** + * Model tests for MetadataStringifiedEntry + */ + @Test + public void testMetadataStringifiedEntry() { + // TODO: test MetadataStringifiedEntry + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedTest.java new file mode 100644 index 0000000..3d3edca --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/MetadataStringifiedTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.MetadataStringifiedEntry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MetadataStringified + */ +public class MetadataStringifiedTest { + private final MetadataStringified model = new MetadataStringified(); + + /** + * Model tests for MetadataStringified + */ + @Test + public void testMetadataStringified() { + // TODO: test MetadataStringified + } + + /** + * Test the property 'entries' + */ + @Test + public void entriesTest() { + // TODO: test entries + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/MultiArrayUDFTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/MultiArrayUDFTest.java new file mode 100644 index 0000000..64c0a9d --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/MultiArrayUDFTest.java @@ -0,0 +1,225 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.QueryRanges; +import io.tiledb.cloud.rest_api.model.ResultFormat; +import io.tiledb.cloud.rest_api.model.TGUDFArgument; +import io.tiledb.cloud.rest_api.model.UDFArrayDetails; +import io.tiledb.cloud.rest_api.model.UDFLanguage; +import io.tiledb.cloud.rest_api.model.UDFSubarray; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MultiArrayUDF + */ +public class MultiArrayUDFTest { + private final MultiArrayUDF model = new MultiArrayUDF(); + + /** + * Model tests for MultiArrayUDF + */ + @Test + public void testMultiArrayUDF() { + // TODO: test MultiArrayUDF + } + + /** + * Test the property 'udfInfoName' + */ + @Test + public void udfInfoNameTest() { + // TODO: test udfInfoName + } + + /** + * Test the property 'language' + */ + @Test + public void languageTest() { + // TODO: test language + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'imageName' + */ + @Test + public void imageNameTest() { + // TODO: test imageName + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'resourceClass' + */ + @Test + public void resourceClassTest() { + // TODO: test resourceClass + } + + /** + * Test the property 'exec' + */ + @Test + public void execTest() { + // TODO: test exec + } + + /** + * Test the property 'execRaw' + */ + @Test + public void execRawTest() { + // TODO: test execRaw + } + + /** + * Test the property 'resultFormat' + */ + @Test + public void resultFormatTest() { + // TODO: test resultFormat + } + + /** + * Test the property 'taskName' + */ + @Test + public void taskNameTest() { + // TODO: test taskName + } + + /** + * Test the property 'argument' + */ + @Test + public void argumentTest() { + // TODO: test argument + } + + /** + * Test the property 'argumentsJson' + */ + @Test + public void argumentsJsonTest() { + // TODO: test argumentsJson + } + + /** + * Test the property 'storedParamUuids' + */ + @Test + public void storedParamUuidsTest() { + // TODO: test storedParamUuids + } + + /** + * Test the property 'storeResults' + */ + @Test + public void storeResultsTest() { + // TODO: test storeResults + } + + /** + * Test the property 'dontDownloadResults' + */ + @Test + public void dontDownloadResultsTest() { + // TODO: test dontDownloadResults + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + + /** + * Test the property 'subarray' + */ + @Test + public void subarrayTest() { + // TODO: test subarray + } + + /** + * Test the property 'buffers' + */ + @Test + public void buffersTest() { + // TODO: test buffers + } + + /** + * Test the property 'arrays' + */ + @Test + public void arraysTest() { + // TODO: test arrays + } + + /** + * Test the property 'timeout' + */ + @Test + public void timeoutTest() { + // TODO: test timeout + } + + /** + * Test the property 'taskGraphUuid' + */ + @Test + public void taskGraphUuidTest() { + // TODO: test taskGraphUuid + } + + /** + * Test the property 'clientNodeUuid' + */ + @Test + public void clientNodeUuidTest() { + // TODO: test clientNodeUuid + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NamespaceActionsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NamespaceActionsTest.java new file mode 100644 index 0000000..d5d93f6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NamespaceActionsTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NamespaceActions + */ +public class NamespaceActionsTest { + /** + * Model tests for NamespaceActions + */ + @Test + public void testNamespaceActions() { + // TODO: test NamespaceActions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NonEmptyDomainTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NonEmptyDomainTest.java new file mode 100644 index 0000000..76b9b70 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NonEmptyDomainTest.java @@ -0,0 +1,57 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.DomainArray; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NonEmptyDomain + */ +public class NonEmptyDomainTest { + private final NonEmptyDomain model = new NonEmptyDomain(); + + /** + * Model tests for NonEmptyDomain + */ + @Test + public void testNonEmptyDomain() { + // TODO: test NonEmptyDomain + } + + /** + * Test the property 'nonEmptyDomain' + */ + @Test + public void nonEmptyDomainTest() { + // TODO: test nonEmptyDomain + } + + /** + * Test the property 'isEmpty' + */ + @Test + public void isEmptyTest() { + // TODO: test isEmpty + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopiedTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopiedTest.java new file mode 100644 index 0000000..0f2c19e --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopiedTest.java @@ -0,0 +1,72 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NotebookCopied + */ +public class NotebookCopiedTest { + private final NotebookCopied model = new NotebookCopied(); + + /** + * Model tests for NotebookCopied + */ + @Test + public void testNotebookCopied() { + // TODO: test NotebookCopied + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopyTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopyTest.java new file mode 100644 index 0000000..3a128f2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookCopyTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NotebookCopy + */ +public class NotebookCopyTest { + private final NotebookCopy model = new NotebookCopy(); + + /** + * Model tests for NotebookCopy + */ + @Test + public void testNotebookCopy() { + // TODO: test NotebookCopy + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoriteTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoriteTest.java new file mode 100644 index 0000000..39c844a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoriteTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NotebookFavorite + */ +public class NotebookFavoriteTest { + private final NotebookFavorite model = new NotebookFavorite(); + + /** + * Model tests for NotebookFavorite + */ + @Test + public void testNotebookFavorite() { + // TODO: test NotebookFavorite + } + + /** + * Test the property 'notebookUuid' + */ + @Test + public void notebookUuidTest() { + // TODO: test notebookUuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesDataTest.java new file mode 100644 index 0000000..62b66f4 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookFavoritesDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NotebookFavoritesData + */ +public class NotebookFavoritesDataTest { + private final NotebookFavoritesData model = new NotebookFavoritesData(); + + /** + * Model tests for NotebookFavoritesData + */ + @Test + public void testNotebookFavoritesData() { + // TODO: test NotebookFavoritesData + } + + /** + * Test the property 'notebooks' + */ + @Test + public void notebooksTest() { + // TODO: test notebooks + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/NotebookStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookStatusTest.java new file mode 100644 index 0000000..afdba1f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/NotebookStatusTest.java @@ -0,0 +1,138 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.PodStatus; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NotebookStatus + */ +public class NotebookStatusTest { + private final NotebookStatus model = new NotebookStatus(); + + /** + * Model tests for NotebookStatus + */ + @Test + public void testNotebookStatus() { + // TODO: test NotebookStatus + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'uptime' + */ + @Test + public void uptimeTest() { + // TODO: test uptime + } + + /** + * Test the property 'cpuUsage' + */ + @Test + public void cpuUsageTest() { + // TODO: test cpuUsage + } + + /** + * Test the property 'gpuUsage' + */ + @Test + public void gpuUsageTest() { + // TODO: test gpuUsage + } + + /** + * Test the property 'memoryUsage' + */ + @Test + public void memoryUsageTest() { + // TODO: test memoryUsage + } + + /** + * Test the property 'gpuLimit' + */ + @Test + public void gpuLimitTest() { + // TODO: test gpuLimit + } + + /** + * Test the property 'memoryLimit' + */ + @Test + public void memoryLimitTest() { + // TODO: test memoryLimit + } + + /** + * Test the property 'storageUsage' + */ + @Test + public void storageUsageTest() { + // TODO: test storageUsage + } + + /** + * Test the property 'storageLimit' + */ + @Test + public void storageLimitTest() { + // TODO: test storageLimit + } + + /** + * Test the property 'cpuCount' + */ + @Test + public void cpuCountTest() { + // TODO: test cpuCount + } + + /** + * Test the property 'cost' + */ + @Test + public void costTest() { + // TODO: test cost + } + + /** + * Test the property 'podStatus' + */ + @Test + public void podStatusTest() { + // TODO: test podStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationRolesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationRolesTest.java new file mode 100644 index 0000000..7f2d138 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationRolesTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OrganizationRoles + */ +public class OrganizationRolesTest { + /** + * Model tests for OrganizationRoles + */ + @Test + public void testOrganizationRoles() { + // TODO: test OrganizationRoles + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationTest.java new file mode 100644 index 0000000..cb0086c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationTest.java @@ -0,0 +1,185 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AssetLocations; +import io.tiledb.cloud.rest_api.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; +import io.tiledb.cloud.rest_api.model.OrganizationUser; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Organization + */ +public class OrganizationTest { + private final Organization model = new Organization(); + + /** + * Model tests for Organization + */ + @Test + public void testOrganization() { + // TODO: test Organization + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'role' + */ + @Test + public void roleTest() { + // TODO: test role + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'users' + */ + @Test + public void usersTest() { + // TODO: test users + } + + /** + * Test the property 'allowedActions' + */ + @Test + public void allowedActionsTest() { + // TODO: test allowedActions + } + + /** + * Test the property 'numOfArrays' + */ + @Test + public void numOfArraysTest() { + // TODO: test numOfArrays + } + + /** + * Test the property 'enabledFeatures' + */ + @Test + public void enabledFeaturesTest() { + // TODO: test enabledFeatures + } + + /** + * Test the property 'unpaidSubscription' + */ + @Test + public void unpaidSubscriptionTest() { + // TODO: test unpaidSubscription + } + + /** + * Test the property 'defaultS3Path' + */ + @Test + public void defaultS3PathTest() { + // TODO: test defaultS3Path + } + + /** + * Test the property 'defaultS3PathCredentialsName' + */ + @Test + public void defaultS3PathCredentialsNameTest() { + // TODO: test defaultS3PathCredentialsName + } + + /** + * Test the property 'assetLocations' + */ + @Test + public void assetLocationsTest() { + // TODO: test assetLocations + } + + /** + * Test the property 'stripeConnect' + */ + @Test + public void stripeConnectTest() { + // TODO: test stripeConnect + } + + /** + * Test the property 'assumeRoleArn' + */ + @Test + public void assumeRoleArnTest() { + // TODO: test assumeRoleArn + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUpdateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUpdateTest.java new file mode 100644 index 0000000..ee75e71 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUpdateTest.java @@ -0,0 +1,90 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AssetLocations; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OrganizationUpdate + */ +public class OrganizationUpdateTest { + private final OrganizationUpdate model = new OrganizationUpdate(); + + /** + * Model tests for OrganizationUpdate + */ + @Test + public void testOrganizationUpdate() { + // TODO: test OrganizationUpdate + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'defaultS3Path' + */ + @Test + public void defaultS3PathTest() { + // TODO: test defaultS3Path + } + + /** + * Test the property 'defaultS3PathCredentialsName' + */ + @Test + public void defaultS3PathCredentialsNameTest() { + // TODO: test defaultS3PathCredentialsName + } + + /** + * Test the property 'assetLocations' + */ + @Test + public void assetLocationsTest() { + // TODO: test assetLocations + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUserTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUserTest.java new file mode 100644 index 0000000..9a4efce --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/OrganizationUserTest.java @@ -0,0 +1,108 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationRoles; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OrganizationUser + */ +public class OrganizationUserTest { + private final OrganizationUser model = new OrganizationUser(); + + /** + * Model tests for OrganizationUser + */ + @Test + public void testOrganizationUser() { + // TODO: test OrganizationUser + } + + /** + * Test the property 'userId' + */ + @Test + public void userIdTest() { + // TODO: test userId + } + + /** + * Test the property 'organizationId' + */ + @Test + public void organizationIdTest() { + // TODO: test organizationId + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'userFullName' + */ + @Test + public void userFullNameTest() { + // TODO: test userFullName + } + + /** + * Test the property 'userEmail' + */ + @Test + public void userEmailTest() { + // TODO: test userEmail + } + + /** + * Test the property 'organizationName' + */ + @Test + public void organizationNameTest() { + // TODO: test organizationName + } + + /** + * Test the property 'role' + */ + @Test + public void roleTest() { + // TODO: test role + } + + /** + * Test the property 'allowedActions' + */ + @Test + public void allowedActionsTest() { + // TODO: test allowedActions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PaginationMetadataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PaginationMetadataTest.java new file mode 100644 index 0000000..394207e --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PaginationMetadataTest.java @@ -0,0 +1,73 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.math.BigDecimal; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PaginationMetadata + */ +public class PaginationMetadataTest { + private final PaginationMetadata model = new PaginationMetadata(); + + /** + * Model tests for PaginationMetadata + */ + @Test + public void testPaginationMetadata() { + // TODO: test PaginationMetadata + } + + /** + * Test the property 'page' + */ + @Test + public void pageTest() { + // TODO: test page + } + + /** + * Test the property 'perPage' + */ + @Test + public void perPageTest() { + // TODO: test perPage + } + + /** + * Test the property 'totalPages' + */ + @Test + public void totalPagesTest() { + // TODO: test totalPages + } + + /** + * Test the property 'totalItems' + */ + @Test + public void totalItemsTest() { + // TODO: test totalItems + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PodStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PodStatusTest.java new file mode 100644 index 0000000..d0c7430 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PodStatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PodStatus + */ +public class PodStatusTest { + /** + * Model tests for PodStatus + */ + @Test + public void testPodStatus() { + // TODO: test PodStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsageTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsageTest.java new file mode 100644 index 0000000..f9292cc --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PricingAggregateUsageTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PricingAggregateUsage + */ +public class PricingAggregateUsageTest { + /** + * Model tests for PricingAggregateUsage + */ + @Test + public void testPricingAggregateUsage() { + // TODO: test PricingAggregateUsage + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PricingCurrencyTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PricingCurrencyTest.java new file mode 100644 index 0000000..e122625 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PricingCurrencyTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PricingCurrency + */ +public class PricingCurrencyTest { + /** + * Model tests for PricingCurrency + */ + @Test + public void testPricingCurrency() { + // TODO: test PricingCurrency + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PricingIntervalTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PricingIntervalTest.java new file mode 100644 index 0000000..9f1cda6 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PricingIntervalTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PricingInterval + */ +public class PricingIntervalTest { + /** + * Model tests for PricingInterval + */ + @Test + public void testPricingInterval() { + // TODO: test PricingInterval + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PricingTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PricingTest.java new file mode 100644 index 0000000..d476ea0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PricingTest.java @@ -0,0 +1,149 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.PricingAggregateUsage; +import io.tiledb.cloud.rest_api.model.PricingCurrency; +import io.tiledb.cloud.rest_api.model.PricingInterval; +import io.tiledb.cloud.rest_api.model.PricingType; +import io.tiledb.cloud.rest_api.model.PricingUnitLabel; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pricing + */ +public class PricingTest { + private final Pricing model = new Pricing(); + + /** + * Model tests for Pricing + */ + @Test + public void testPricing() { + // TODO: test Pricing + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'arrayUuid' + */ + @Test + public void arrayUuidTest() { + // TODO: test arrayUuid + } + + /** + * Test the property 'pricingName' + */ + @Test + public void pricingNameTest() { + // TODO: test pricingName + } + + /** + * Test the property 'pricingType' + */ + @Test + public void pricingTypeTest() { + // TODO: test pricingType + } + + /** + * Test the property 'productName' + */ + @Test + public void productNameTest() { + // TODO: test productName + } + + /** + * Test the property 'productStatementDescriptor' + */ + @Test + public void productStatementDescriptorTest() { + // TODO: test productStatementDescriptor + } + + /** + * Test the property 'productUnitLabel' + */ + @Test + public void productUnitLabelTest() { + // TODO: test productUnitLabel + } + + /** + * Test the property 'currency' + */ + @Test + public void currencyTest() { + // TODO: test currency + } + + /** + * Test the property 'aggregateUsage' + */ + @Test + public void aggregateUsageTest() { + // TODO: test aggregateUsage + } + + /** + * Test the property 'interval' + */ + @Test + public void intervalTest() { + // TODO: test interval + } + + /** + * Test the property 'dividedBy' + */ + @Test + public void dividedByTest() { + // TODO: test dividedBy + } + + /** + * Test the property 'charge' + */ + @Test + public void chargeTest() { + // TODO: test charge + } + + /** + * Test the property 'activated' + */ + @Test + public void activatedTest() { + // TODO: test activated + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PricingTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PricingTypeTest.java new file mode 100644 index 0000000..0497ac8 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PricingTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PricingType + */ +public class PricingTypeTest { + /** + * Model tests for PricingType + */ + @Test + public void testPricingType() { + // TODO: test PricingType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PricingUnitLabelTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PricingUnitLabelTest.java new file mode 100644 index 0000000..ba88f3c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PricingUnitLabelTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PricingUnitLabel + */ +public class PricingUnitLabelTest { + /** + * Model tests for PricingUnitLabel + */ + @Test + public void testPricingUnitLabel() { + // TODO: test PricingUnitLabel + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/PublicShareFilterTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/PublicShareFilterTest.java new file mode 100644 index 0000000..f6165a0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/PublicShareFilterTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PublicShareFilter + */ +public class PublicShareFilterTest { + /** + * Model tests for PublicShareFilter + */ + @Test + public void testPublicShareFilter() { + // TODO: test PublicShareFilter + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/QueryJsonTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/QueryJsonTest.java new file mode 100644 index 0000000..db804ac --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/QueryJsonTest.java @@ -0,0 +1,59 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.QueryRanges; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for QueryJson + */ +public class QueryJsonTest { + private final QueryJson model = new QueryJson(); + + /** + * Model tests for QueryJson + */ + @Test + public void testQueryJson() { + // TODO: test QueryJson + } + + /** + * Test the property 'queryRanges' + */ + @Test + public void queryRangesTest() { + // TODO: test queryRanges + } + + /** + * Test the property 'fields' + */ + @Test + public void fieldsTest() { + // TODO: test fields + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/QueryRangesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/QueryRangesTest.java new file mode 100644 index 0000000..b9b3097 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/QueryRangesTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Layout; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for QueryRanges + */ +public class QueryRangesTest { + private final QueryRanges model = new QueryRanges(); + + /** + * Model tests for QueryRanges + */ + @Test + public void testQueryRanges() { + // TODO: test QueryRanges + } + + /** + * Test the property 'layout' + */ + @Test + public void layoutTest() { + // TODO: test layout + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/QueryReaderTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/QueryReaderTest.java new file mode 100644 index 0000000..44200f1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/QueryReaderTest.java @@ -0,0 +1,91 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Layout; +import io.tiledb.cloud.rest_api.model.ReadState; +import io.tiledb.cloud.rest_api.model.Subarray; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for QueryReader + */ +public class QueryReaderTest { + private final QueryReader model = new QueryReader(); + + /** + * Model tests for QueryReader + */ + @Test + public void testQueryReader() { + // TODO: test QueryReader + } + + /** + * Test the property 'layout' + */ + @Test + public void layoutTest() { + // TODO: test layout + } + + /** + * Test the property 'subarray' + */ + @Test + public void subarrayTest() { + // TODO: test subarray + } + + /** + * Test the property 'readState' + */ + @Test + public void readStateTest() { + // TODO: test readState + } + + /** + * Test the property 'varOffsetsMode' + */ + @Test + public void varOffsetsModeTest() { + // TODO: test varOffsetsMode + } + + /** + * Test the property 'varOffsetsAddExtraElement' + */ + @Test + public void varOffsetsAddExtraElementTest() { + // TODO: test varOffsetsAddExtraElement + } + + /** + * Test the property 'varOffsetsBitsize' + */ + @Test + public void varOffsetsBitsizeTest() { + // TODO: test varOffsetsBitsize + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/QueryTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/QueryTest.java new file mode 100644 index 0000000..e06fb52 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/QueryTest.java @@ -0,0 +1,120 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AttributeBufferHeader; +import io.tiledb.cloud.rest_api.model.Layout; +import io.tiledb.cloud.rest_api.model.QueryReader; +import io.tiledb.cloud.rest_api.model.Querystatus; +import io.tiledb.cloud.rest_api.model.Querytype; +import io.tiledb.cloud.rest_api.model.Writer; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Query + */ +public class QueryTest { + private final Query model = new Query(); + + /** + * Model tests for Query + */ + @Test + public void testQuery() { + // TODO: test Query + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'layout' + */ + @Test + public void layoutTest() { + // TODO: test layout + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'attributeBufferHeaders' + */ + @Test + public void attributeBufferHeadersTest() { + // TODO: test attributeBufferHeaders + } + + /** + * Test the property 'writer' + */ + @Test + public void writerTest() { + // TODO: test writer + } + + /** + * Test the property 'reader' + */ + @Test + public void readerTest() { + // TODO: test reader + } + + /** + * Test the property 'array' + */ + @Test + public void arrayTest() { + // TODO: test array + } + + /** + * Test the property 'totalFixedLengthBufferBytes' + */ + @Test + public void totalFixedLengthBufferBytesTest() { + // TODO: test totalFixedLengthBufferBytes + } + + /** + * Test the property 'totalVarLenBufferBytes' + */ + @Test + public void totalVarLenBufferBytesTest() { + // TODO: test totalVarLenBufferBytes + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/QuerystatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/QuerystatusTest.java new file mode 100644 index 0000000..3da5ce2 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/QuerystatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Querystatus + */ +public class QuerystatusTest { + /** + * Model tests for Querystatus + */ + @Test + public void testQuerystatus() { + // TODO: test Querystatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/QuerytypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/QuerytypeTest.java new file mode 100644 index 0000000..1d0bc89 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/QuerytypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Querytype + */ +public class QuerytypeTest { + /** + * Model tests for Querytype + */ + @Test + public void testQuerytype() { + // TODO: test Querytype + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ReadStateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ReadStateTest.java new file mode 100644 index 0000000..ab1245a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ReadStateTest.java @@ -0,0 +1,73 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.SubarrayPartitioner; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadState + */ +public class ReadStateTest { + private final ReadState model = new ReadState(); + + /** + * Model tests for ReadState + */ + @Test + public void testReadState() { + // TODO: test ReadState + } + + /** + * Test the property 'initialized' + */ + @Test + public void initializedTest() { + // TODO: test initialized + } + + /** + * Test the property 'overflowed' + */ + @Test + public void overflowedTest() { + // TODO: test overflowed + } + + /** + * Test the property 'unsplittable' + */ + @Test + public void unsplittableTest() { + // TODO: test unsplittable + } + + /** + * Test the property 'subarrayPartitioner' + */ + @Test + public void subarrayPartitionerTest() { + // TODO: test subarrayPartitioner + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraphTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraphTest.java new file mode 100644 index 0000000..be76e73 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/RegisteredTaskGraphTest.java @@ -0,0 +1,108 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TaskGraphNode; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RegisteredTaskGraph + */ +public class RegisteredTaskGraphTest { + private final RegisteredTaskGraph model = new RegisteredTaskGraph(); + + /** + * Model tests for RegisteredTaskGraph + */ + @Test + public void testRegisteredTaskGraph() { + // TODO: test RegisteredTaskGraph + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'readme' + */ + @Test + public void readmeTest() { + // TODO: test readme + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'nodes' + */ + @Test + public void nodesTest() { + // TODO: test nodes + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequestTest.java new file mode 100644 index 0000000..34b3984 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ResetUserPasswordRequestTest.java @@ -0,0 +1,48 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ResetUserPasswordRequest + */ +public class ResetUserPasswordRequestTest { + private final ResetUserPasswordRequest model = new ResetUserPasswordRequest(); + + /** + * Model tests for ResetUserPasswordRequest + */ + @Test + public void testResetUserPasswordRequest() { + // TODO: test ResetUserPasswordRequest + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/ResultFormatTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/ResultFormatTest.java new file mode 100644 index 0000000..38b9006 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/ResultFormatTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ResultFormat + */ +public class ResultFormatTest { + /** + * Model tests for ResultFormat + */ + @Test + public void testResultFormat() { + // TODO: test ResultFormat + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/RetryPolicyTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/RetryPolicyTest.java new file mode 100644 index 0000000..51cc819 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/RetryPolicyTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RetryPolicy + */ +public class RetryPolicyTest { + /** + * Model tests for RetryPolicy + */ + @Test + public void testRetryPolicy() { + // TODO: test RetryPolicy + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/RetryStrategyTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/RetryStrategyTest.java new file mode 100644 index 0000000..602c20b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/RetryStrategyTest.java @@ -0,0 +1,74 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Backoff; +import io.tiledb.cloud.rest_api.model.RetryPolicy; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RetryStrategy + */ +public class RetryStrategyTest { + private final RetryStrategy model = new RetryStrategy(); + + /** + * Model tests for RetryStrategy + */ + @Test + public void testRetryStrategy() { + // TODO: test RetryStrategy + } + + /** + * Test the property 'backoff' + */ + @Test + public void backoffTest() { + // TODO: test backoff + } + + /** + * Test the property 'expression' + */ + @Test + public void expressionTest() { + // TODO: test expression + } + + /** + * Test the property 'limit' + */ + @Test + public void limitTest() { + // TODO: test limit + } + + /** + * Test the property 'retryPolicy' + */ + @Test + public void retryPolicyTest() { + // TODO: test retryPolicy + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SQLParametersTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SQLParametersTest.java new file mode 100644 index 0000000..90859a1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SQLParametersTest.java @@ -0,0 +1,131 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ResultFormat; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SQLParameters + */ +public class SQLParametersTest { + private final SQLParameters model = new SQLParameters(); + + /** + * Model tests for SQLParameters + */ + @Test + public void testSQLParameters() { + // TODO: test SQLParameters + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'storeResults' + */ + @Test + public void storeResultsTest() { + // TODO: test storeResults + } + + /** + * Test the property 'dontDownloadResults' + */ + @Test + public void dontDownloadResultsTest() { + // TODO: test dontDownloadResults + } + + /** + * Test the property 'resourceClass' + */ + @Test + public void resourceClassTest() { + // TODO: test resourceClass + } + + /** + * Test the property 'resultFormat' + */ + @Test + public void resultFormatTest() { + // TODO: test resultFormat + } + + /** + * Test the property 'initCommands' + */ + @Test + public void initCommandsTest() { + // TODO: test initCommands + } + + /** + * Test the property 'parameters' + */ + @Test + public void parametersTest() { + // TODO: test parameters + } + + /** + * Test the property 'taskGraphUuid' + */ + @Test + public void taskGraphUuidTest() { + // TODO: test taskGraphUuid + } + + /** + * Test the property 'clientNodeUuid' + */ + @Test + public void clientNodeUuidTest() { + // TODO: test clientNodeUuid + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponseTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponseTest.java new file mode 100644 index 0000000..a6f87d0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigResponseTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.SSODomainConfig; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SSODomainConfigResponse + */ +public class SSODomainConfigResponseTest { + private final SSODomainConfigResponse model = new SSODomainConfigResponse(); + + /** + * Model tests for SSODomainConfigResponse + */ + @Test + public void testSSODomainConfigResponse() { + // TODO: test SSODomainConfigResponse + } + + /** + * Test the property 'domainConfigs' + */ + @Test + public void domainConfigsTest() { + // TODO: test domainConfigs + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigTest.java new file mode 100644 index 0000000..b6b8e6b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainConfigTest.java @@ -0,0 +1,110 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.DomainCheckResult; +import io.tiledb.cloud.rest_api.model.DomainVerificationStatus; +import io.tiledb.cloud.rest_api.model.SSODomainSetup; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SSODomainConfig + */ +public class SSODomainConfigTest { + private final SSODomainConfig model = new SSODomainConfig(); + + /** + * Model tests for SSODomainConfig + */ + @Test + public void testSSODomainConfig() { + // TODO: test SSODomainConfig + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'domain' + */ + @Test + public void domainTest() { + // TODO: test domain + } + + /** + * Test the property 'oidcIssuer' + */ + @Test + public void oidcIssuerTest() { + // TODO: test oidcIssuer + } + + /** + * Test the property 'oidcClientId' + */ + @Test + public void oidcClientIdTest() { + // TODO: test oidcClientId + } + + /** + * Test the property 'oidcClientSecret' + */ + @Test + public void oidcClientSecretTest() { + // TODO: test oidcClientSecret + } + + /** + * Test the property 'domainSetup' + */ + @Test + public void domainSetupTest() { + // TODO: test domainSetup + } + + /** + * Test the property 'verificationStatus' + */ + @Test + public void verificationStatusTest() { + // TODO: test verificationStatus + } + + /** + * Test the property 'checkResults' + */ + @Test + public void checkResultsTest() { + // TODO: test checkResults + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainSetupTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainSetupTest.java new file mode 100644 index 0000000..48c7e97 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SSODomainSetupTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SSODomainSetup + */ +public class SSODomainSetupTest { + private final SSODomainSetup model = new SSODomainSetup(); + + /** + * Model tests for SSODomainSetup + */ + @Test + public void testSSODomainSetup() { + // TODO: test SSODomainSetup + } + + /** + * Test the property 'txt' + */ + @Test + public void txtTest() { + // TODO: test txt + } + + /** + * Test the property 'cnameSrc' + */ + @Test + public void cnameSrcTest() { + // TODO: test cnameSrc + } + + /** + * Test the property 'cnameDst' + */ + @Test + public void cnameDstTest() { + // TODO: test cnameDst + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SSOProviderTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SSOProviderTest.java new file mode 100644 index 0000000..e945209 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SSOProviderTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SSOProvider + */ +public class SSOProviderTest { + /** + * Model tests for SSOProvider + */ + @Test + public void testSSOProvider() { + // TODO: test SSOProvider + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SharePaymentRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SharePaymentRequestTest.java new file mode 100644 index 0000000..dbf5bb4 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SharePaymentRequestTest.java @@ -0,0 +1,50 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SharePaymentRequest + */ +public class SharePaymentRequestTest { + private final SharePaymentRequest model = new SharePaymentRequest(); + + /** + * Model tests for SharePaymentRequest + */ + @Test + public void testSharePaymentRequest() { + // TODO: test SharePaymentRequest + } + + /** + * Test the property 'namespaces' + */ + @Test + public void namespacesTest() { + // TODO: test namespaces + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfoTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfoTest.java new file mode 100644 index 0000000..0f5dd37 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SingleFragmentInfoTest.java @@ -0,0 +1,57 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.FragmentMetadata; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleFragmentInfo + */ +public class SingleFragmentInfoTest { + private final SingleFragmentInfo model = new SingleFragmentInfo(); + + /** + * Model tests for SingleFragmentInfo + */ + @Test + public void testSingleFragmentInfo() { + // TODO: test SingleFragmentInfo + } + + /** + * Test the property 'arraySchemaName' + */ + @Test + public void arraySchemaNameTest() { + // TODO: test arraySchemaName + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/StorageLocationTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/StorageLocationTest.java new file mode 100644 index 0000000..05302a0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/StorageLocationTest.java @@ -0,0 +1,57 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StorageLocation + */ +public class StorageLocationTest { + private final StorageLocation model = new StorageLocation(); + + /** + * Model tests for StorageLocation + */ + @Test + public void testStorageLocation() { + // TODO: test StorageLocation + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + + /** + * Test the property 'credentialsName' + */ + @Test + public void credentialsNameTest() { + // TODO: test credentialsName + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrentTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrentTest.java new file mode 100644 index 0000000..d8b5dab --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerCurrentTest.java @@ -0,0 +1,73 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Subarray; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SubarrayPartitionerCurrent + */ +public class SubarrayPartitionerCurrentTest { + private final SubarrayPartitionerCurrent model = new SubarrayPartitionerCurrent(); + + /** + * Model tests for SubarrayPartitionerCurrent + */ + @Test + public void testSubarrayPartitionerCurrent() { + // TODO: test SubarrayPartitionerCurrent + } + + /** + * Test the property 'subarray' + */ + @Test + public void subarrayTest() { + // TODO: test subarray + } + + /** + * Test the property 'start' + */ + @Test + public void startTest() { + // TODO: test start + } + + /** + * Test the property 'end' + */ + @Test + public void endTest() { + // TODO: test end + } + + /** + * Test the property 'splitMultiRange' + */ + @Test + public void splitMultiRangeTest() { + // TODO: test splitMultiRange + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerStateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerStateTest.java new file mode 100644 index 0000000..71b5f58 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerStateTest.java @@ -0,0 +1,75 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Subarray; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SubarrayPartitionerState + */ +public class SubarrayPartitionerStateTest { + private final SubarrayPartitionerState model = new SubarrayPartitionerState(); + + /** + * Model tests for SubarrayPartitionerState + */ + @Test + public void testSubarrayPartitionerState() { + // TODO: test SubarrayPartitionerState + } + + /** + * Test the property 'start' + */ + @Test + public void startTest() { + // TODO: test start + } + + /** + * Test the property 'end' + */ + @Test + public void endTest() { + // TODO: test end + } + + /** + * Test the property 'singleRange' + */ + @Test + public void singleRangeTest() { + // TODO: test singleRange + } + + /** + * Test the property 'multiRange' + */ + @Test + public void multiRangeTest() { + // TODO: test multiRange + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerTest.java new file mode 100644 index 0000000..e16535c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayPartitionerTest.java @@ -0,0 +1,94 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AttributeBufferSize; +import io.tiledb.cloud.rest_api.model.Subarray; +import io.tiledb.cloud.rest_api.model.SubarrayPartitionerCurrent; +import io.tiledb.cloud.rest_api.model.SubarrayPartitionerState; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SubarrayPartitioner + */ +public class SubarrayPartitionerTest { + private final SubarrayPartitioner model = new SubarrayPartitioner(); + + /** + * Model tests for SubarrayPartitioner + */ + @Test + public void testSubarrayPartitioner() { + // TODO: test SubarrayPartitioner + } + + /** + * Test the property 'subarray' + */ + @Test + public void subarrayTest() { + // TODO: test subarray + } + + /** + * Test the property 'budget' + */ + @Test + public void budgetTest() { + // TODO: test budget + } + + /** + * Test the property 'current' + */ + @Test + public void currentTest() { + // TODO: test current + } + + /** + * Test the property 'state' + */ + @Test + public void stateTest() { + // TODO: test state + } + + /** + * Test the property 'memoryBudget' + */ + @Test + public void memoryBudgetTest() { + // TODO: test memoryBudget + } + + /** + * Test the property 'memoryBudgetVar' + */ + @Test + public void memoryBudgetVarTest() { + // TODO: test memoryBudgetVar + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayRangesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayRangesTest.java new file mode 100644 index 0000000..5b2d5b9 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayRangesTest.java @@ -0,0 +1,67 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Datatype; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SubarrayRanges + */ +public class SubarrayRangesTest { + private final SubarrayRanges model = new SubarrayRanges(); + + /** + * Model tests for SubarrayRanges + */ + @Test + public void testSubarrayRanges() { + // TODO: test SubarrayRanges + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'hasDefaultRange' + */ + @Test + public void hasDefaultRangeTest() { + // TODO: test hasDefaultRange + } + + /** + * Test the property 'buffer' + */ + @Test + public void bufferTest() { + // TODO: test buffer + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayTest.java new file mode 100644 index 0000000..e2bbd69 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SubarrayTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Layout; +import io.tiledb.cloud.rest_api.model.SubarrayRanges; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Subarray + */ +public class SubarrayTest { + private final Subarray model = new Subarray(); + + /** + * Model tests for Subarray + */ + @Test + public void testSubarray() { + // TODO: test Subarray + } + + /** + * Test the property 'layout' + */ + @Test + public void layoutTest() { + // TODO: test layout + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/SubscriptionTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/SubscriptionTest.java new file mode 100644 index 0000000..d9353ef --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/SubscriptionTest.java @@ -0,0 +1,75 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Pricing; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Subscription + */ +public class SubscriptionTest { + private final Subscription model = new Subscription(); + + /** + * Model tests for Subscription + */ + @Test + public void testSubscription() { + // TODO: test Subscription + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'ownerNamespaceUuid' + */ + @Test + public void ownerNamespaceUuidTest() { + // TODO: test ownerNamespaceUuid + } + + /** + * Test the property 'customerNamespaceUuid' + */ + @Test + public void customerNamespaceUuidTest() { + // TODO: test customerNamespaceUuid + } + + /** + * Test the property 'pricing' + */ + @Test + public void pricingTest() { + // TODO: test pricing + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGArrayNodeDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGArrayNodeDataTest.java new file mode 100644 index 0000000..14932b1 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGArrayNodeDataTest.java @@ -0,0 +1,65 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TGQueryRanges; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGArrayNodeData + */ +public class TGArrayNodeDataTest { + private final TGArrayNodeData model = new TGArrayNodeData(); + + /** + * Model tests for TGArrayNodeData + */ + @Test + public void testTGArrayNodeData() { + // TODO: test TGArrayNodeData + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + + /** + * Test the property 'buffers' + */ + @Test + public void buffersTest() { + // TODO: test buffers + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGInputNodeDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGInputNodeDataTest.java new file mode 100644 index 0000000..4c98e54 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGInputNodeDataTest.java @@ -0,0 +1,57 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGInputNodeData + */ +public class TGInputNodeDataTest { + private final TGInputNodeData model = new TGInputNodeData(); + + /** + * Model tests for TGInputNodeData + */ + @Test + public void testTGInputNodeData() { + // TODO: test TGInputNodeData + } + + /** + * Test the property 'defaultValue' + */ + @Test + public void defaultValueTest() { + // TODO: test defaultValue + } + + /** + * Test the property 'datatype' + */ + @Test + public void datatypeTest() { + // TODO: test datatype + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGQueryRangesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGQueryRangesTest.java new file mode 100644 index 0000000..1285707 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGQueryRangesTest.java @@ -0,0 +1,65 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Layout; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGQueryRanges + */ +public class TGQueryRangesTest { + private final TGQueryRanges model = new TGQueryRanges(); + + /** + * Model tests for TGQueryRanges + */ + @Test + public void testTGQueryRanges() { + // TODO: test TGQueryRanges + } + + /** + * Test the property 'layout' + */ + @Test + public void layoutTest() { + // TODO: test layout + } + + /** + * Test the property 'friendlyRanges' + */ + @Test + public void friendlyRangesTest() { + // TODO: test friendlyRanges + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGSQLNodeDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGSQLNodeDataTest.java new file mode 100644 index 0000000..4c89d97 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGSQLNodeDataTest.java @@ -0,0 +1,84 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ResultFormat; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGSQLNodeData + */ +public class TGSQLNodeDataTest { + private final TGSQLNodeData model = new TGSQLNodeData(); + + /** + * Model tests for TGSQLNodeData + */ + @Test + public void testTGSQLNodeData() { + // TODO: test TGSQLNodeData + } + + /** + * Test the property 'initCommands' + */ + @Test + public void initCommandsTest() { + // TODO: test initCommands + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'parameters' + */ + @Test + public void parametersTest() { + // TODO: test parameters + } + + /** + * Test the property 'resultFormat' + */ + @Test + public void resultFormatTest() { + // TODO: test resultFormat + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFArgumentTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFArgumentTest.java new file mode 100644 index 0000000..170c749 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFArgumentTest.java @@ -0,0 +1,57 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGUDFArgument + */ +public class TGUDFArgumentTest { + private final TGUDFArgument model = new TGUDFArgument(); + + /** + * Model tests for TGUDFArgument + */ + @Test + public void testTGUDFArgument() { + // TODO: test TGUDFArgument + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResourcesTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResourcesTest.java new file mode 100644 index 0000000..1f21731 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentResourcesTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGUDFEnvironmentResources + */ +public class TGUDFEnvironmentResourcesTest { + private final TGUDFEnvironmentResources model = new TGUDFEnvironmentResources(); + + /** + * Model tests for TGUDFEnvironmentResources + */ + @Test + public void testTGUDFEnvironmentResources() { + // TODO: test TGUDFEnvironmentResources + } + + /** + * Test the property 'cpu' + */ + @Test + public void cpuTest() { + // TODO: test cpu + } + + /** + * Test the property 'memory' + */ + @Test + public void memoryTest() { + // TODO: test memory + } + + /** + * Test the property 'gpu' + */ + @Test + public void gpuTest() { + // TODO: test gpu + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentTest.java new file mode 100644 index 0000000..8a53301 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFEnvironmentTest.java @@ -0,0 +1,127 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TGUDFEnvironmentResources; +import io.tiledb.cloud.rest_api.model.TGUDFStorage; +import io.tiledb.cloud.rest_api.model.UDFLanguage; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGUDFEnvironment + */ +public class TGUDFEnvironmentTest { + private final TGUDFEnvironment model = new TGUDFEnvironment(); + + /** + * Model tests for TGUDFEnvironment + */ + @Test + public void testTGUDFEnvironment() { + // TODO: test TGUDFEnvironment + } + + /** + * Test the property 'language' + */ + @Test + public void languageTest() { + // TODO: test language + } + + /** + * Test the property 'languageVersion' + */ + @Test + public void languageVersionTest() { + // TODO: test languageVersion + } + + /** + * Test the property 'imageName' + */ + @Test + public void imageNameTest() { + // TODO: test imageName + } + + /** + * Test the property 'accessCredentialsName' + */ + @Test + public void accessCredentialsNameTest() { + // TODO: test accessCredentialsName + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'resourceClass' + */ + @Test + public void resourceClassTest() { + // TODO: test resourceClass + } + + /** + * Test the property 'resources' + */ + @Test + public void resourcesTest() { + // TODO: test resources + } + + /** + * Test the property 'runClientSide' + */ + @Test + public void runClientSideTest() { + // TODO: test runClientSide + } + + /** + * Test the property 'timeout' + */ + @Test + public void timeoutTest() { + // TODO: test timeout + } + + /** + * Test the property 'storage' + */ + @Test + public void storageTest() { + // TODO: test storage + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFNodeDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFNodeDataTest.java new file mode 100644 index 0000000..39c3b78 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFNodeDataTest.java @@ -0,0 +1,94 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ResultFormat; +import io.tiledb.cloud.rest_api.model.TGUDFArgument; +import io.tiledb.cloud.rest_api.model.TGUDFEnvironment; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGUDFNodeData + */ +public class TGUDFNodeDataTest { + private final TGUDFNodeData model = new TGUDFNodeData(); + + /** + * Model tests for TGUDFNodeData + */ + @Test + public void testTGUDFNodeData() { + // TODO: test TGUDFNodeData + } + + /** + * Test the property 'registeredUdfName' + */ + @Test + public void registeredUdfNameTest() { + // TODO: test registeredUdfName + } + + /** + * Test the property 'executableCode' + */ + @Test + public void executableCodeTest() { + // TODO: test executableCode + } + + /** + * Test the property 'sourceText' + */ + @Test + public void sourceTextTest() { + // TODO: test sourceText + } + + /** + * Test the property 'environment' + */ + @Test + public void environmentTest() { + // TODO: test environment + } + + /** + * Test the property 'arguments' + */ + @Test + public void argumentsTest() { + // TODO: test arguments + } + + /** + * Test the property 'resultFormat' + */ + @Test + public void resultFormatTest() { + // TODO: test resultFormat + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFStorageTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFStorageTest.java new file mode 100644 index 0000000..f330c18 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TGUDFStorageTest.java @@ -0,0 +1,72 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TGUDFStorage + */ +public class TGUDFStorageTest { + private final TGUDFStorage model = new TGUDFStorage(); + + /** + * Model tests for TGUDFStorage + */ + @Test + public void testTGUDFStorage() { + // TODO: test TGUDFStorage + } + + /** + * Test the property 'path' + */ + @Test + public void pathTest() { + // TODO: test path + } + + /** + * Test the property 'tiledbUri' + */ + @Test + public void tiledbUriTest() { + // TODO: test tiledbUri + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'storageClass' + */ + @Test + public void storageClassTest() { + // TODO: test storageClass + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphActionsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphActionsTest.java new file mode 100644 index 0000000..16d4636 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphActionsTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphActions + */ +public class TaskGraphActionsTest { + /** + * Model tests for TaskGraphActions + */ + @Test + public void testTaskGraphActions() { + // TODO: test TaskGraphActions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatusTest.java new file mode 100644 index 0000000..9e20b5c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphClientNodeStatusTest.java @@ -0,0 +1,57 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayTaskStatus; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphClientNodeStatus + */ +public class TaskGraphClientNodeStatusTest { + private final TaskGraphClientNodeStatus model = new TaskGraphClientNodeStatus(); + + /** + * Model tests for TaskGraphClientNodeStatus + */ + @Test + public void testTaskGraphClientNodeStatus() { + // TODO: test TaskGraphClientNodeStatus + } + + /** + * Test the property 'clientNodeUuid' + */ + @Test + public void clientNodeUuidTest() { + // TODO: test clientNodeUuid + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocationTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocationTest.java new file mode 100644 index 0000000..ec0eff8 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogRunLocationTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphLogRunLocation + */ +public class TaskGraphLogRunLocationTest { + /** + * Model tests for TaskGraphLogRunLocation + */ + @Test + public void testTaskGraphLogRunLocation() { + // TODO: test TaskGraphLogRunLocation + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatusTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatusTest.java new file mode 100644 index 0000000..4a25b77 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogStatusTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphLogStatus + */ +public class TaskGraphLogStatusTest { + /** + * Model tests for TaskGraphLogStatus + */ + @Test + public void testTaskGraphLogStatus() { + // TODO: test TaskGraphLogStatus + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogTest.java new file mode 100644 index 0000000..66c1274 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogTest.java @@ -0,0 +1,210 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TaskGraphLogStatus; +import io.tiledb.cloud.rest_api.model.TaskGraphNodeMetadata; +import io.tiledb.cloud.rest_api.model.TaskGraphType; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphLog + */ +public class TaskGraphLogTest { + private final TaskGraphLog model = new TaskGraphLog(); + + /** + * Model tests for TaskGraphLog + */ + @Test + public void testTaskGraphLog() { + // TODO: test TaskGraphLog + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'createdBy' + */ + @Test + public void createdByTest() { + // TODO: test createdBy + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'startTime' + */ + @Test + public void startTimeTest() { + // TODO: test startTime + } + + /** + * Test the property 'endTime' + */ + @Test + public void endTimeTest() { + // TODO: test endTime + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + + /** + * Test the property 'accessCost' + */ + @Test + public void accessCostTest() { + // TODO: test accessCost + } + + /** + * Test the property 'egressCost' + */ + @Test + public void egressCostTest() { + // TODO: test egressCost + } + + /** + * Test the property 'executionTime' + */ + @Test + public void executionTimeTest() { + // TODO: test executionTime + } + + /** + * Test the property 'statusCount' + */ + @Test + public void statusCountTest() { + // TODO: test statusCount + } + + /** + * Test the property 'nodes' + */ + @Test + public void nodesTest() { + // TODO: test nodes + } + + /** + * Test the property 'taskGraphType' + */ + @Test + public void taskGraphTypeTest() { + // TODO: test taskGraphType + } + + /** + * Test the property 'taskGraphId' + */ + @Test + public void taskGraphIdTest() { + // TODO: test taskGraphId + } + + /** + * Test the property 'cloudProvider' + */ + @Test + public void cloudProviderTest() { + // TODO: test cloudProvider + } + + /** + * Test the property 'cloudRegion' + */ + @Test + public void cloudRegionTest() { + // TODO: test cloudRegion + } + + /** + * Test the property 'rootTaskGraphUuid' + */ + @Test + public void rootTaskGraphUuidTest() { + // TODO: test rootTaskGraphUuid + } + + /** + * Test the property 'childrenTaskGraphUuids' + */ + @Test + public void childrenTaskGraphUuidsTest() { + // TODO: test childrenTaskGraphUuids + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsDataTest.java new file mode 100644 index 0000000..959bb6e --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphLogsDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.PaginationMetadata; +import io.tiledb.cloud.rest_api.model.TaskGraphLog; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphLogsData + */ +public class TaskGraphLogsDataTest { + private final TaskGraphLogsData model = new TaskGraphLogsData(); + + /** + * Model tests for TaskGraphLogsData + */ + @Test + public void testTaskGraphLogsData() { + // TODO: test TaskGraphLogsData + } + + /** + * Test the property 'taskGraphLogs' + */ + @Test + public void taskGraphLogsTest() { + // TODO: test taskGraphLogs + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadataTest.java new file mode 100644 index 0000000..c286f7f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeMetadataTest.java @@ -0,0 +1,102 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayTask; +import io.tiledb.cloud.rest_api.model.ArrayTaskStatus; +import io.tiledb.cloud.rest_api.model.TaskGraphLogRunLocation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphNodeMetadata + */ +public class TaskGraphNodeMetadataTest { + private final TaskGraphNodeMetadata model = new TaskGraphNodeMetadata(); + + /** + * Model tests for TaskGraphNodeMetadata + */ + @Test + public void testTaskGraphNodeMetadata() { + // TODO: test TaskGraphNodeMetadata + } + + /** + * Test the property 'clientNodeUuid' + */ + @Test + public void clientNodeUuidTest() { + // TODO: test clientNodeUuid + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'dependsOn' + */ + @Test + public void dependsOnTest() { + // TODO: test dependsOn + } + + /** + * Test the property 'runLocation' + */ + @Test + public void runLocationTest() { + // TODO: test runLocation + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'statusMessage' + */ + @Test + public void statusMessageTest() { + // TODO: test statusMessage + } + + /** + * Test the property 'executions' + */ + @Test + public void executionsTest() { + // TODO: test executions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeTest.java new file mode 100644 index 0000000..26177fc --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphNodeTest.java @@ -0,0 +1,128 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.RetryStrategy; +import io.tiledb.cloud.rest_api.model.TGInputNodeData; +import io.tiledb.cloud.rest_api.model.TGSQLNodeData; +import io.tiledb.cloud.rest_api.model.TGUDFNodeData; +import io.tiledb.cloud.rest_api.model.UDFArrayDetails; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphNode + */ +public class TaskGraphNodeTest { + private final TaskGraphNode model = new TaskGraphNode(); + + /** + * Model tests for TaskGraphNode + */ + @Test + public void testTaskGraphNode() { + // TODO: test TaskGraphNode + } + + /** + * Test the property 'clientNodeId' + */ + @Test + public void clientNodeIdTest() { + // TODO: test clientNodeId + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'dependsOn' + */ + @Test + public void dependsOnTest() { + // TODO: test dependsOn + } + + /** + * Test the property 'arrayNode' + */ + @Test + public void arrayNodeTest() { + // TODO: test arrayNode + } + + /** + * Test the property 'inputNode' + */ + @Test + public void inputNodeTest() { + // TODO: test inputNode + } + + /** + * Test the property 'sqlNode' + */ + @Test + public void sqlNodeTest() { + // TODO: test sqlNode + } + + /** + * Test the property 'udfNode' + */ + @Test + public void udfNodeTest() { + // TODO: test udfNode + } + + /** + * Test the property 'retryStrategy' + */ + @Test + public void retryStrategyTest() { + // TODO: test retryStrategy + } + + /** + * Test the property 'expandNodeOutput' + */ + @Test + public void expandNodeOutputTest() { + // TODO: test expandNodeOutput + } + + /** + * Test the property 'deadline' + */ + @Test + public void deadlineTest() { + // TODO: test deadline + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphSharingTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphSharingTest.java new file mode 100644 index 0000000..1c4366c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphSharingTest.java @@ -0,0 +1,67 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TaskGraphActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphSharing + */ +public class TaskGraphSharingTest { + private final TaskGraphSharing model = new TaskGraphSharing(); + + /** + * Model tests for TaskGraphSharing + */ + @Test + public void testTaskGraphSharing() { + // TODO: test TaskGraphSharing + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'namespaceType' + */ + @Test + public void namespaceTypeTest() { + // TODO: test namespaceType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTest.java new file mode 100644 index 0000000..4b31500 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTest.java @@ -0,0 +1,127 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.RetryStrategy; +import io.tiledb.cloud.rest_api.model.TaskGraphNode; +import io.tiledb.cloud.rest_api.model.TaskGraphType; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraph + */ +public class TaskGraphTest { + private final TaskGraph model = new TaskGraph(); + + /** + * Model tests for TaskGraph + */ + @Test + public void testTaskGraph() { + // TODO: test TaskGraph + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'createdBy' + */ + @Test + public void createdByTest() { + // TODO: test createdBy + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'nodes' + */ + @Test + public void nodesTest() { + // TODO: test nodes + } + + /** + * Test the property 'parallelism' + */ + @Test + public void parallelismTest() { + // TODO: test parallelism + } + + /** + * Test the property 'retryStrategy' + */ + @Test + public void retryStrategyTest() { + // TODO: test retryStrategy + } + + /** + * Test the property 'deadline' + */ + @Test + public void deadlineTest() { + // TODO: test deadline + } + + /** + * Test the property 'taskGraphType' + */ + @Test + public void taskGraphTypeTest() { + // TODO: test taskGraphType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTypeTest.java new file mode 100644 index 0000000..e50f617 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphType + */ +public class TaskGraphTypeTest { + /** + * Model tests for TaskGraphType + */ + @Test + public void testTaskGraphType() { + // TODO: test TaskGraphType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphsTest.java new file mode 100644 index 0000000..c23168b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TaskGraphsTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TaskGraph; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TaskGraphs + */ +public class TaskGraphsTest { + private final TaskGraphs model = new TaskGraphs(); + + /** + * Model tests for TaskGraphs + */ + @Test + public void testTaskGraphs() { + // TODO: test TaskGraphs + } + + /** + * Test the property 'graphs' + */ + @Test + public void graphsTest() { + // TODO: test graphs + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInnerTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInnerTest.java new file mode 100644 index 0000000..9e6a32a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigEntriesInnerTest.java @@ -0,0 +1,56 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TileDBConfigEntriesInner + */ +public class TileDBConfigEntriesInnerTest { + private final TileDBConfigEntriesInner model = new TileDBConfigEntriesInner(); + + /** + * Model tests for TileDBConfigEntriesInner + */ + @Test + public void testTileDBConfigEntriesInner() { + // TODO: test TileDBConfigEntriesInner + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigTest.java new file mode 100644 index 0000000..ac32736 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TileDBConfigTest.java @@ -0,0 +1,51 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TileDBConfigEntriesInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TileDBConfig + */ +public class TileDBConfigTest { + private final TileDBConfig model = new TileDBConfig(); + + /** + * Model tests for TileDBConfig + */ + @Test + public void testTileDBConfig() { + // TODO: test TileDBConfig + } + + /** + * Test the property 'entries' + */ + @Test + public void entriesTest() { + // TODO: test entries + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TokenRequestTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TokenRequestTest.java new file mode 100644 index 0000000..9277524 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TokenRequestTest.java @@ -0,0 +1,68 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TokenScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TokenRequest + */ +public class TokenRequestTest { + private final TokenRequest model = new TokenRequest(); + + /** + * Model tests for TokenRequest + */ + @Test + public void testTokenRequest() { + // TODO: test TokenRequest + } + + /** + * Test the property 'expires' + */ + @Test + public void expiresTest() { + // TODO: test expires + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'scope' + */ + @Test + public void scopeTest() { + // TODO: test scope + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TokenScopeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TokenScopeTest.java new file mode 100644 index 0000000..6750521 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TokenScopeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TokenScope + */ +public class TokenScopeTest { + /** + * Model tests for TokenScope + */ + @Test + public void testTokenScope() { + // TODO: test TokenScope + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/TokenTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/TokenTest.java new file mode 100644 index 0000000..c4335dc --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/TokenTest.java @@ -0,0 +1,84 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.TokenScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Token + */ +public class TokenTest { + private final Token model = new Token(); + + /** + * Model tests for Token + */ + @Test + public void testToken() { + // TODO: test Token + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + // TODO: test token + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'issuedAt' + */ + @Test + public void issuedAtTest() { + // TODO: test issuedAt + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + + /** + * Test the property 'scope' + */ + @Test + public void scopeTest() { + // TODO: test scope + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFActionsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFActionsTest.java new file mode 100644 index 0000000..e5d8ee8 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFActionsTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFActions + */ +public class UDFActionsTest { + /** + * Model tests for UDFActions + */ + @Test + public void testUDFActions() { + // TODO: test UDFActions + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFArrayDetailsTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFArrayDetailsTest.java new file mode 100644 index 0000000..8b688b5 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFArrayDetailsTest.java @@ -0,0 +1,76 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.QueryRanges; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFArrayDetails + */ +public class UDFArrayDetailsTest { + private final UDFArrayDetails model = new UDFArrayDetails(); + + /** + * Model tests for UDFArrayDetails + */ + @Test + public void testUDFArrayDetails() { + // TODO: test UDFArrayDetails + } + + /** + * Test the property 'parameterId' + */ + @Test + public void parameterIdTest() { + // TODO: test parameterId + } + + /** + * Test the property 'uri' + */ + @Test + public void uriTest() { + // TODO: test uri + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + + /** + * Test the property 'buffers' + */ + @Test + public void buffersTest() { + // TODO: test buffers + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFCopiedTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFCopiedTest.java new file mode 100644 index 0000000..d10d7c0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFCopiedTest.java @@ -0,0 +1,72 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFCopied + */ +public class UDFCopiedTest { + private final UDFCopied model = new UDFCopied(); + + /** + * Model tests for UDFCopied + */ + @Test + public void testUDFCopied() { + // TODO: test UDFCopied + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFCopyTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFCopyTest.java new file mode 100644 index 0000000..2f6f82b --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFCopyTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFCopy + */ +public class UDFCopyTest { + private final UDFCopy model = new UDFCopy(); + + /** + * Model tests for UDFCopy + */ + @Test + public void testUDFCopy() { + // TODO: test UDFCopy + } + + /** + * Test the property 'outputUri' + */ + @Test + public void outputUriTest() { + // TODO: test outputUri + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoriteTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoriteTest.java new file mode 100644 index 0000000..42b8c70 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoriteTest.java @@ -0,0 +1,64 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFFavorite + */ +public class UDFFavoriteTest { + private final UDFFavorite model = new UDFFavorite(); + + /** + * Model tests for UDFFavorite + */ + @Test + public void testUDFFavorite() { + // TODO: test UDFFavorite + } + + /** + * Test the property 'udfUuid' + */ + @Test + public void udfUuidTest() { + // TODO: test udfUuid + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoritesDataTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoritesDataTest.java new file mode 100644 index 0000000..abda37f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFFavoritesDataTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.ArrayInfo; +import io.tiledb.cloud.rest_api.model.PaginationMetadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFFavoritesData + */ +public class UDFFavoritesDataTest { + private final UDFFavoritesData model = new UDFFavoritesData(); + + /** + * Model tests for UDFFavoritesData + */ + @Test + public void testUDFFavoritesData() { + // TODO: test UDFFavoritesData + } + + /** + * Test the property 'udfs' + */ + @Test + public void udfsTest() { + // TODO: test udfs + } + + /** + * Test the property 'paginationMetadata' + */ + @Test + public void paginationMetadataTest() { + // TODO: test paginationMetadata + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFImageTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFImageTest.java new file mode 100644 index 0000000..6a5ec44 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFImageTest.java @@ -0,0 +1,65 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.UDFLanguage; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFImage + */ +public class UDFImageTest { + private final UDFImage model = new UDFImage(); + + /** + * Model tests for UDFImage + */ + @Test + public void testUDFImage() { + // TODO: test UDFImage + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'language' + */ + @Test + public void languageTest() { + // TODO: test language + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFImageVersionTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFImageVersionTest.java new file mode 100644 index 0000000..71fcd4c --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFImageVersionTest.java @@ -0,0 +1,97 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.math.BigDecimal; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFImageVersion + */ +public class UDFImageVersionTest { + private final UDFImageVersion model = new UDFImageVersion(); + + /** + * Model tests for UDFImageVersion + */ + @Test + public void testUDFImageVersion() { + // TODO: test UDFImageVersion + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'udfImageUuid' + */ + @Test + public void udfImageUuidTest() { + // TODO: test udfImageUuid + } + + /** + * Test the property 'dockerImage' + */ + @Test + public void dockerImageTest() { + // TODO: test dockerImage + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property '_default' + */ + @Test + public void _defaultTest() { + // TODO: test _default + } + + /** + * Test the property 'latest' + */ + @Test + public void latestTest() { + // TODO: test latest + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoTest.java new file mode 100644 index 0000000..d4a6e91 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoTest.java @@ -0,0 +1,108 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.UDFLanguage; +import io.tiledb.cloud.rest_api.model.UDFType; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFInfo + */ +public class UDFInfoTest { + private final UDFInfo model = new UDFInfo(); + + /** + * Model tests for UDFInfo + */ + @Test + public void testUDFInfo() { + // TODO: test UDFInfo + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'language' + */ + @Test + public void languageTest() { + // TODO: test language + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'readme' + */ + @Test + public void readmeTest() { + // TODO: test readme + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdateTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdateTest.java new file mode 100644 index 0000000..d16291a --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFInfoUpdateTest.java @@ -0,0 +1,132 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.UDFLanguage; +import io.tiledb.cloud.rest_api.model.UDFType; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFInfoUpdate + */ +public class UDFInfoUpdateTest { + private final UDFInfoUpdate model = new UDFInfoUpdate(); + + /** + * Model tests for UDFInfoUpdate + */ + @Test + public void testUDFInfoUpdate() { + // TODO: test UDFInfoUpdate + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'language' + */ + @Test + public void languageTest() { + // TODO: test language + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'imageName' + */ + @Test + public void imageNameTest() { + // TODO: test imageName + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'exec' + */ + @Test + public void execTest() { + // TODO: test exec + } + + /** + * Test the property 'execRaw' + */ + @Test + public void execRawTest() { + // TODO: test execRaw + } + + /** + * Test the property 'readme' + */ + @Test + public void readmeTest() { + // TODO: test readme + } + + /** + * Test the property 'licenseId' + */ + @Test + public void licenseIdTest() { + // TODO: test licenseId + } + + /** + * Test the property 'licenseText' + */ + @Test + public void licenseTextTest() { + // TODO: test licenseText + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFLanguageTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFLanguageTest.java new file mode 100644 index 0000000..8aca766 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFLanguageTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFLanguage + */ +public class UDFLanguageTest { + /** + * Model tests for UDFLanguage + */ + @Test + public void testUDFLanguage() { + // TODO: test UDFLanguage + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFSharingTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFSharingTest.java new file mode 100644 index 0000000..2d945d0 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFSharingTest.java @@ -0,0 +1,67 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.UDFActions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFSharing + */ +public class UDFSharingTest { + private final UDFSharing model = new UDFSharing(); + + /** + * Model tests for UDFSharing + */ + @Test + public void testUDFSharing() { + // TODO: test UDFSharing + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'namespaceType' + */ + @Test + public void namespaceTypeTest() { + // TODO: test namespaceType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRangeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRangeTest.java new file mode 100644 index 0000000..befdd55 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayRangeTest.java @@ -0,0 +1,65 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.DimensionCoordinate; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFSubarrayRange + */ +public class UDFSubarrayRangeTest { + private final UDFSubarrayRange model = new UDFSubarrayRange(); + + /** + * Model tests for UDFSubarrayRange + */ + @Test + public void testUDFSubarrayRange() { + // TODO: test UDFSubarrayRange + } + + /** + * Test the property 'dimensionId' + */ + @Test + public void dimensionIdTest() { + // TODO: test dimensionId + } + + /** + * Test the property 'rangeStart' + */ + @Test + public void rangeStartTest() { + // TODO: test rangeStart + } + + /** + * Test the property 'rangeEnd' + */ + @Test + public void rangeEndTest() { + // TODO: test rangeEnd + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayTest.java new file mode 100644 index 0000000..889f74f --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFSubarrayTest.java @@ -0,0 +1,60 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.Layout; +import io.tiledb.cloud.rest_api.model.UDFSubarrayRange; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFSubarray + */ +public class UDFSubarrayTest { + private final UDFSubarray model = new UDFSubarray(); + + /** + * Model tests for UDFSubarray + */ + @Test + public void testUDFSubarray() { + // TODO: test UDFSubarray + } + + /** + * Test the property 'layout' + */ + @Test + public void layoutTest() { + // TODO: test layout + } + + /** + * Test the property 'ranges' + */ + @Test + public void rangesTest() { + // TODO: test ranges + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UDFTypeTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UDFTypeTest.java new file mode 100644 index 0000000..bac3003 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UDFTypeTest.java @@ -0,0 +1,32 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UDFType + */ +public class UDFTypeTest { + /** + * Model tests for UDFType + */ + @Test + public void testUDFType() { + // TODO: test UDFType + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/UserTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/UserTest.java new file mode 100644 index 0000000..e53fbfe --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/UserTest.java @@ -0,0 +1,198 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.AssetLocations; +import io.tiledb.cloud.rest_api.model.NamespaceActions; +import io.tiledb.cloud.rest_api.model.OrganizationUser; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'isValidEmail' + */ + @Test + public void isValidEmailTest() { + // TODO: test isValidEmail + } + + /** + * Test the property 'stripeConnect' + */ + @Test + public void stripeConnectTest() { + // TODO: test stripeConnect + } + + /** + * Test the property 'company' + */ + @Test + public void companyTest() { + // TODO: test company + } + + /** + * Test the property 'logo' + */ + @Test + public void logoTest() { + // TODO: test logo + } + + /** + * Test the property 'timezone' + */ + @Test + public void timezoneTest() { + // TODO: test timezone + } + + /** + * Test the property 'organizations' + */ + @Test + public void organizationsTest() { + // TODO: test organizations + } + + /** + * Test the property 'allowedActions' + */ + @Test + public void allowedActionsTest() { + // TODO: test allowedActions + } + + /** + * Test the property 'enabledFeatures' + */ + @Test + public void enabledFeaturesTest() { + // TODO: test enabledFeatures + } + + /** + * Test the property 'unpaidSubscription' + */ + @Test + public void unpaidSubscriptionTest() { + // TODO: test unpaidSubscription + } + + /** + * Test the property 'defaultS3Path' + */ + @Test + public void defaultS3PathTest() { + // TODO: test defaultS3Path + } + + /** + * Test the property 'defaultS3PathCredentialsName' + */ + @Test + public void defaultS3PathCredentialsNameTest() { + // TODO: test defaultS3PathCredentialsName + } + + /** + * Test the property 'assetLocations' + */ + @Test + public void assetLocationsTest() { + // TODO: test assetLocations + } + + /** + * Test the property 'defaultNamespaceCharged' + */ + @Test + public void defaultNamespaceChargedTest() { + // TODO: test defaultNamespaceCharged + } + + /** + * Test the property 'defaultRegion' + */ + @Test + public void defaultRegionTest() { + // TODO: test defaultRegion + } + +} diff --git a/src/test/java/io/tiledb/cloud/rest_api/model/WriterTest.java b/src/test/java/io/tiledb/cloud/rest_api/model/WriterTest.java new file mode 100644 index 0000000..35521a4 --- /dev/null +++ b/src/test/java/io/tiledb/cloud/rest_api/model/WriterTest.java @@ -0,0 +1,73 @@ +/* + * TileDB Storage Platform API + * TileDB Storage Platform REST API + * + * The version of the OpenAPI document: 2.17.51 + * + * + * 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.model; + +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.model.DomainArray; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Writer + */ +public class WriterTest { + private final Writer model = new Writer(); + + /** + * Model tests for Writer + */ + @Test + public void testWriter() { + // TODO: test Writer + } + + /** + * Test the property 'checkCoordDups' + */ + @Test + public void checkCoordDupsTest() { + // TODO: test checkCoordDups + } + + /** + * Test the property 'checkCoordOOB' + */ + @Test + public void checkCoordOOBTest() { + // TODO: test checkCoordOOB + } + + /** + * Test the property 'dedupCoords' + */ + @Test + public void dedupCoordsTest() { + // TODO: test dedupCoords + } + + /** + * Test the property 'subarray' + */ + @Test + public void subarrayTest() { + // TODO: test subarray + } + +}